WeCodeAcademy

A First Look at Classes

A class is a blueprint for objects that bundle data and behaviour.

Examplepython
Open in editor »
Quick check

What is __init__ used for?

Your turn: write the code

Finish the class Dog so that speak() returns the dog's name followed by says woof.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.