Put in order · Python course · Module 3: Object-Oriented Programming
Class with a Method
Arrange the lines of an Animal class with a constructor (first method) and a describe() method:
Items to put in order
- return f"This is {self.name}"
- def __init__(self, name):
- class Animal:
- self.name = name
- def describe(self):
You can check the correct answer by solving this task in the CodeWorlds game.