Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
What is the output of calling n2.calculate()? class Addition: def __init__(self, f, s): self.first = f self.second = s def calc...Question
What is the output of calling n2.calculate ()?
class Addition:
def _init_(self, f, s):
self.first = f
self.second = s
def calculate(self):
self.answer = self.first + self.second
print("Addition of two numbers = " + str(self.answer))
n1 = Addition(1000, 2000)
n2 = Addition(3000,1000)
n3 = Addition(2000, 4000)
n4 = Addition(3000,4000)
1.Addition of two numbers = 6000
2.Addition of two numbers = 4000
3.Addition of two numbers = 3000
4.Addition of two numbers = 7000
class Addition:
def _init_(self, f, s):
self.first = f
self.second = s
def calculate(self):
self.answer = self.first + self.second
print("Addition of two numbers = " + str(self.answer))
n1 = Addition(1000, 2000)
n2 = Addition(3000,1000)
n3 = Addition(2000, 4000)
n4 = Addition(3000,4000)
1.Addition of two numbers = 6000
2.Addition of two numbers = 4000
3.Addition of two numbers = 3000
4.Addition of two numbers = 7000
Answers
There are no human answers yet.
Answered by
GPT 3.5
The output of calling n2.calculate() is:
Addition of two numbers = 4000
Addition of two numbers = 4000
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.