Which line of code will use the overloaded multiplication operation?
class num:
def __init__...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 28.04.2021 19:40 angelrenee2000
Which line of code will use the overloaded multiplication operation?
class num:
def __init__(self, a):
self. number = a
def __add__(self, b):
return self. number + 2 * b. number
def __mul__(self, b):
return self. number + b. number
def __pow__(self, b):
return self. number + b. number
# main program
numA = num(5)
numB = num(10)
Which line of code will use the overloaded multiplication operation?
class num:
def __init__(self, a):
self. number = a
def __add__(self, b):
return self. number + 2 * b. number
def __mul__(self, b):
return self. number + b. number
def __pow__(self, b):
return self. number + b. number
# main program
numA = num(5)
numB = num(10)
a) product = numA * numB
b) product = numA. multiply(numB)
c) product = numA. mul(numB
![ansver](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 02:00
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 17.02.2021 18:00
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 17.02.2021 18:00
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.02.2021 18:00
![question](/tpl/images/cats/himiya.png)
Chemistry, 17.02.2021 18:00
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 17.02.2021 18:00
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 17.02.2021 18:00
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 17.02.2021 18:00
![question](/tpl/images/cats/mat.png)
Mathematics, 17.02.2021 18:00
![question](/tpl/images/cats/en.png)
English, 17.02.2021 18:00