Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Learn Python multiple inheritance in 8 minutes! ๐ŸŸ
Play lesson

Python tutorial for beginners ๐Ÿ - Learn Python multiple inheritance in 8 minutes! ๐ŸŸ

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

00:00:00 multiple inheritance 00:03:29 multilevel inheritance 00:05:03 attributes class Animal: def __init__(self, name): self.name = name def eat(self): print(f"{self.name} is eating") def sleep(self): print(f"{self.name} is sleeping") class Prey(Animal): def flee(self): print(f"{self.name} is fleeing") class Predator(Animal): def hunt(self): print(f"{self.name} is hunting") class Rabbit(Prey): pass class Hawk(Predator): pass class Fish(Prey, Predator): pass rabbit = Rabbit("Bugs") hawk = Hawk("Tony") fish = Fish("Nemo")

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere