← All practice pages

Python

Python Classes & Objects

A class describes a kind of thing: the data it carries and what it can do. Each object you create from it keeps its own copy of that data.

Try it now

Define a class "Dog" with an __init__ that stores name and breed, and a method "bark()" that returns the string "Woof!".

Create a free account to run your answer and get ARIA's review.