Home / Expert Answers / Computer Science / which-of-the-following-code-blocks-produces-39-the-sum-of-5-and-3-is-8-39-as-the-output-group-of-ans-pa502

# (Solved): Which of the following code blocks produces 'The sum of 5 and 3 is 8' as the output? Group of answer ...

Which of the following code blocks produces 'The sum of 5 and 3 is 8' as the output? Group of answer choices class Sum: def __init__(self, num1, num2): self.num1 = num1 self.num2 = num2 return('The sum of {} and {} is {}'.format(self.num1, self.num2, self.num1 + self.num2)) print(Sum(5, 3)) class Sum: def __init__(self, num1, num2): self.num1 = num1 self.num2 = num2 def __str__(self): return('The sum of {} and {} is {}'.format(self.num1, self.num2, self.num1 + self.num2)) print(Sum(5, 3)) class Sum: def __init__(self, num1, num2): self.num1 = num1 self.num2 = num2 def __str__(self): return('The sum of {} and {} is {}'.format(self.num1, self.num2, self.num1 + self.num2)) print(Sum()) class Sum: def __init__(self, num1, num2): self.num1 = num1 self.num2 = num2 def __str__(self): return('The sum of {} and {} is {}'.format(self.num1, self.num2, self.num1 + self.num2)) print(Sum(5, 3, 8))

We have an Answer from Expert