Aan de slagGa gratis aan de slag

Correct use of __init__

Python allows you to run custom code - for example, initializing attributes - any time an object is created: you just need to define a special method called __init__(). Use this exercise to check your understanding of __init__() mechanics!

Which of the code blocks will NOT return an error when run?

4 code blocks

Deze oefening maakt deel uit van de cursus

Introduction to Object-Oriented Programming in Python

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen