35.0k views
0 votes
How do I convert years to days on Python. For example, if I were to enter 3 years it should output "You are 1095 days old".

User Mohan Seth
by
7.3k points

1 Answer

2 votes

years = int(input("Enter the # of years: "))

print("You are "+str(years*365)+" days old")

I wrote the code in python 3.8. I hope this helps!

User Ibn Rushd
by
7.1k points