Skip to content

Instantly share code, notes, and snippets.

View mertdotcc's full-sized avatar
🪐

Mert Öztürk mertdotcc

🪐
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
student_3 = Student.from_string(student_3_string)
class Student():
def __init__(self, first_name, last_name, birth_year, emergency_contact):
self.first_name = first_name
self.last_name = last_name
self.birth_year = birth_year
self.emergency_contact = emergency_contact
@classmethod
def from_string(cls, student_string):
student_3_string = "Dwight-Schrute-1970-angela_martin@office.com"
student_1 = Student("Cecelia", "Halpert", "2010", "jim_halpert@office.com")
student_2 = Student("Phillip", "Halpert", "2012", "pam_halpert@office.com")
@mertdotcc
mertdotcc / alternative_constructors_1.py
Last active June 24, 2020 09:09
Alternative Constructors Blog Post
class Student():
def __init__(self, first_name, last_name, birth_year, emergency_contact):
self.first_name = first_name
self.last_name = last_name
self.birth_year = birth_year
self.emergency_contact = emergency_contact