I'm a bit confused with this task I have to implement objects into my class. In my tutorials, they just say "do this this this then boom, magic" (from what I understood)
Why then do I have to do in like lets say, email, from my understanding in the tutorials:
class Counselor:
def __init__(self,first,last,schedule):
self.first = first
self.last = last
self.email = first + '.' + last + '@gmail.com'
self.schedule = schedule
Counselor_1 = Counselor(first = 'Casey', last = 'Scout',schedule ='Mon-Fri 2-5PM')
print("Email:", Counselor_1.email)
Whereas in my teachers tutorial which is after the video tutorial from YT I followed for lets say focusing on the email it is doing:
def __init__(self,id_number,name,degree_program, birthday):
self.email_address = None
def get_email(self):
return self.emailaddress
if _ _ name _ _ == "_ _ main _ _"
student1 = Student(name = John Doe, etc., etc. etc.,)
#then in for email it's just
student1.set_email("[email protected]")
print("Email address: ", student1.get_email() )
