Skip to content

Instantly share code, notes, and snippets.

@ycui1
Last active Oct 11, 2021
Embed
What would you like to do?
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