How to calculate age using input() in Python

preview_player
Показать описание
import datetime
Year = int(input(" Please enter the year you were born "))
Month = int(input(" Please enter the number of the month you were born. For example 3 = March "))
Day = int(input(" Please enter the day you were born "))
AgeYears = convertdays/365
print("Or " + str(AgeYears) + " years old to be less precise!")
Рекомендации по теме
Комментарии
Автор

thank you very much, I like u, helped me very much

mohammedalkhatimsalih
Автор

Hello, When trying to run this code I keep getting an error with line 7. Saying:
NameError: Name 'datetime' is not defined
I am new to Python, why is this happening?
Thank you for the video.

woohoo
Автор

Really helped man thanks a lot for this video !

motivationpouretudier
Автор

Please do computing edexcel controlled assessment 2017 task 3

cutfrommarble
Автор

what if we want to enter date like 1995/02/03

amirrezaes