Which line of code will use the overloaded addition operation?
class num:
def __init__(self,...
![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 09.04.2021 01:30, Kicanty20
Which line of code will use the overloaded addition 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)
1)result. add(numA, numB)
2)result = numA + numB
3)result = numA. add(numB)
![answer](/tpl/images/cats/otvet.png)
Answers: 2
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 17:00, bnvghnbbb
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:30, hailey5campbelp7d1c0
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 07:00, bskyeb14579
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
Do you know the correct answer?
Questions in other subjects:
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/informatica.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/es.png)
Spanish, 19.05.2021 15:10
![Konu](/tpl/images/cats/ekonomika.png)
Business, 19.05.2021 15:10
![Konu](/tpl/images/cats/mat.png)
Mathematics, 19.05.2021 15:10
![Konu](/tpl/images/cats/istoriya.png)
History, 19.05.2021 15:10
![Konu](/tpl/images/cats/en.png)
English, 19.05.2021 15:10
![Konu](/tpl/images/cats/en.png)
English, 19.05.2021 15:10