+ 11
Is there a way for me to take an input, and use it in a mathematical question, and print the answer?
4 Respuestas
+ 7
modified your code a bit
# import datetime to get current date
import datetime
# get current time
now = datetime.datetime.now()
# get user age and convert to int (for substraction)
x=int(input('What is your age?'))
# substract age from current year
print ("\nAwesome! you were born in ", now.year-x)
+ 7
thanks a lot
+ 7
can you check it? its called: birth date discoverer
+ 5
sure thing