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?

Questo esercizio fa parte del corso
Introduction to Object-Oriented Programming in Python
Esercizio pratico interattivo
Passa dalla teoria alla pratica con uno dei nostri esercizi interattivi
Inizia esercizio