Skip to content

Instantly share code, notes, and snippets.

@ycui1
Last active October 11, 2021 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycui1/8669d0716ea1650e930084fe03401b52 to your computer and use it in GitHub Desktop.
Save ycui1/8669d0716ea1650e930084fe03401b52 to your computer and use it in GitHub Desktop.
class Student:
def __init__(self, name):
self.name = name
def study(self):
print(f"The student {self.name} is studying.")
@staticmethod
def is_adult(age):
return age >= 18
@classmethod
def students_from_list(cls, names):
return [cls(name) for name in names]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment