Last active
October 11, 2021 02:09
-
-
Save ycui1/8669d0716ea1650e930084fe03401b52 to your computer and use it in GitHub Desktop.
This file contains 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, 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