Multi-level Inheritance In Python Is Easy!🐍

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • PLEASE LIKE AND SUBSCRIBE ITS FREE!
    #beginners #tutorial #python
    Check out my other videos to learn more computer science & programming concepts please :)
    Code used in the video will be pinned in the comments!
    Socials and other platforms:
    linktr.ee/Yous...

Комментарии • 3

  • @YousefCompSci
    @YousefCompSci  2 дня назад +2

    # multi-level inheritance = when a child class inherits from another child class
    class Car:
    working = True
    class Chevy(Car):
    def drive(self):
    print("This car is driving")
    class Corvette(Chevy):
    def race(self):
    print("This corvette is fast")
    corvette = Corvette()
    print(corvette.working)
    corvette.drive()
    corvette.race()

  • @yousef1291_
    @yousef1291_ 2 дня назад +1

    🎉🎉🎉

  • @Monsta1291
    @Monsta1291 2 дня назад +1