Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is my code can you fix the error, how can I import the module datetime? import datetime class Person: This is for class
This is my code can you fix the error, how can I import the module datetime?
import datetime 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 my error
Traceback (most recent call last): File "/Users/meera/PycharmProjects/LAB3/qusetion 5.py", line 28, in
how can I import datatime!!!!!! can you show me please please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started