Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Car:
- @classmethod
- def run(cls):
- return cls.get_name()
- @staticmethod
- def get_name():
- return "Car"
- class Toyota(Car):
- @staticmethod
- def get_name():
- return "Toyota"
- if __name__ == '__main__':
- print(Car.run())
- print(Toyota.run())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement