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

Contenu du cours

Object-Oriented Programming in Python

Object-Oriented Programming in Python

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

book
Challenge

Tâche

Swipe to start coding

  1. Create the Cat class:
  • Set info and make_sound methods inside the Cat class;
  • Inside the make_sound method print 'Meow'.
  1. Create the Dog class:
  • Set info and make_sound methods inside the Dog class;
  • Inside the make_sound method print 'Bark'.
  1. Create cat and dog objects based on the Cat and Dog classes respectively.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 2
toggle bottom row

book
Challenge

Tâche

Swipe to start coding

  1. Create the Cat class:
  • Set info and make_sound methods inside the Cat class;
  • Inside the make_sound method print 'Meow'.
  1. Create the Dog class:
  • Set info and make_sound methods inside the Dog class;
  • Inside the make_sound method print 'Bark'.
  1. Create cat and dog objects based on the Cat and Dog classes respectively.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 2
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt