Skip to content

Instantly share code, notes, and snippets.

@ycui1
Created August 2, 2020 23:08
Show Gist options
  • Select an option

  • Save ycui1/ba3bb8f8de651c4fd5c8127bc16c4cc7 to your computer and use it in GitHub Desktop.

Select an option

Save ycui1/ba3bb8f8de651c4fd5c8127bc16c4cc7 to your computer and use it in GitHub Desktop.
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