Quiz

Test your understanding of the concepts explained in this chapter with this quiz!

1

What will be the output of the following code?

class Scores:
    def __init__(self, s1, s2):
      self.scores = s1 + s2
    def display(self, scores):
      print(scores)
 
x = Scores(5,10)
setattr(x, 'scores', x.scores+1)
x.display(x.scores)
A)

15

B)

6

C)

16

D)

Error

Question 1 of 40 attempted

Get hands-on with 1200+ tech skills courses.