Conteúdo do Curso
Object-Oriented Programming in Python
Object-Oriented Programming in Python
Challenge
Note
Private methods and attributes of the parent class are not available in the child's class.
The Animal
class:
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tudo estava claro?
Challenge
Note
Private methods and attributes of the parent class are not available in the child's class.
The Animal
class:
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tudo estava claro?
Challenge
Note
Private methods and attributes of the parent class are not available in the child's class.
The Animal
class:
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).
Tudo estava claro?
Note
Private methods and attributes of the parent class are not available in the child's class.
The Animal
class:
Tarefa
- Create a class
Cat
that inherits theAnimal
class. - Create the
eat
method. - Create a
5
kg10
years old'Lola'
cat. - Move the cat (using the
move()
method from theAnimal
class). - 'Feed' the cat (using the
eat()
method from theCat
class).