Question: what is the wrong here? and how can I solve this error class Person: This is for class person def __init__(self,name,surname,birthdate,address,phonenumber,email): self.name= name self.surname

what is the wrong here? and how can I solve this error

class Person: """ This is for class person""" def __init__(self,name,surname,birthdate,address,phonenumber,email): self.name= name self.surname = surname self.birthdate = birthdate self.phonenumber = phonenumber self.address=address self.email=email def age(self): today= datetime.date.today() age=today.year - self.birthdate.year if today < datetime.date(today.year,self.birthdate.month,self.birthdate.day): age-=1 return age p = Person('Meera', 'Amna', datetime.date(2000, 8, 3), 'Ajman', '055677720', 'm22@mail.com') print(p.name) print(p.surname) print(p.birthdate) print(p.phonenumber) print(p.age()) print(p.address) print(p.email) 

-----

this is the error:

Traceback (most recent call last): File "/Users/meera/PycharmProjects/LAB3/qusetion 5.py", line 25, in p = Person('Meera', 'Amna', datetime.date(2000, 8, 3), 'Ajman', '055677720', 'm22@mail.com') NameError: name 'datetime' is not defined

Process finished with exit code 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!