Python object-oriented quiz

  • Admin
  • 1 min read

Eight questions on classes, objects, init, self, methods and inheritance.

Python

Python object-oriented quiz

8 questions, instant feedback

Question 1 of 8 Which keyword defines a class?
Question 2 of 8 When does __init__ run?
Question 3 of 8 What does self refer to inside a method?
Question 4 of 8 How do you make Dog inherit from Animal?
Question 5 of 8 In a class, an attribute is…
Question 6 of 8 A method is…
Question 7 of 8 What does __str__ control?
Question 8 of 8 Which line creates an object from a class called Task?

Your answers stay in this browser. Nothing is sent to a server.