Quiz

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

We'll cover the following...
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
Access this course and 1400+ top-rated courses and projects.