Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge | Polymorphism
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Object-Oriented Programming in Python
Sectionย 4. Chapterย 2
single

single

bookChallenge

Swipe to show menu

Task

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 desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 4. Chapterย 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt