Created
August 2, 2020 23:08
-
-
Save ycui1/ba3bb8f8de651c4fd5c8127bc16c4cc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Student: | |
| def __init__(self, first_name, last_name): | |
| self.first_name = first_name | |
| self.last_name = last_name | |
| def begin_study(self): | |
| print(f"{self.first_name} {self.last_name} begins studying.") | |
| @classmethod | |
| def from_dict(cls, name_info): | |
| first_name = name_info['first_name'] | |
| last_name = name_info['last_name'] | |
| return cls(first_name, last_name) | |
| @staticmethod | |
| def show_duties(): | |
| return "Study, Play, Sleep" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment