Computers and Technology
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
Answers: 2

Other questions on the subject: Computers and Technology

image
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
Computers and Technology, 23.06.2019 00:30, alex7078
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
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
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?
Which line of code will use the overloaded addition operation? class num:
def __init__(self,...

Questions in other subjects:

Konu
Business, 19.05.2021 15:10
Konu
English, 19.05.2021 15:10