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

Course Content

Object-Oriented Programming in Python

Object-Oriented Programming in Python

Challenge

Task

  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.

Task

  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.

Everything was clear?

Section 4. Chapter 2
toggle bottom row

Challenge

Task

  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.

Task

  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.

Everything was clear?

Section 4. Chapter 2
toggle bottom row

Challenge

Task

  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.

Task

  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.

Everything was clear?

Task

  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.

Section 4. Chapter 2
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt