Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Inheritance
Object-Oriented Programming in Python
course content

Зміст курсу

Object-Oriented Programming in Python

Object-Oriented Programming in Python

1. Classes and Objects
2. Encapsulation
3. Inheritance
4. Polymorphism

Challenge

Note

Private methods and attributes of the parent class are not available in the child's class.

The Animal class:

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row

Challenge

Note

Private methods and attributes of the parent class are not available in the child's class.

The Animal class:

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Все було зрозуміло?

Секція 3. Розділ 2
toggle bottom row

Challenge

Note

Private methods and attributes of the parent class are not available in the child's class.

The Animal class:

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Все було зрозуміло?

Note

Private methods and attributes of the parent class are not available in the child's class.

The Animal class:

Завдання

  1. Create a class Cat that inherits the Animal class.
  2. Create the eat method.
  3. Create a 5 kg 10 years old 'Lola' cat.
  4. Move the cat (using the move() method from the Animal class).
  5. 'Feed' the cat (using the eat() method from the Cat class).

Секція 3. Розділ 2
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt