Skills101
← All practice quizzes

Quiz: Python OOP

5 questionsNo time limitPass: 60%+10 XP on first pass

Classes as blueprints and objects as things made from them. init, self, methods, class vs instance attributes, inheritance, super() and dunder methods like str.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does self refer to inside a method?

  2. Question 2

    When does __init__ run?

  3. Question 3

    What does this print?

    class A:
        def hello(self):
            return "A"
    class B(A):
        def hello(self):
            return "B"
    print(B().hello())
    
  4. Question 4

    What does super().__init__(name) do in a child class?

  5. Question 5

    Which method controls what print(obj) shows?