Q. Write a program that asks a user for a number of years, and then prints out the number of days, hours, minutes and seconds in that number of years.
How many years? 10
10.0 years is:
3650.0 days
87600.0 hours
5256800:0 minutes
315360000.0 seconds
Answer :-
year = int (input ( "How many years?" ) ) print (year,"years is:") print (365*year, "days") print (24*365*year, "hours") print (60*24*365*year, "minutes") print (60*60*24*365*year, "seconds")
Output :-
How many years?40
40 years is:
14600 days
350400 hours
21024000 minutes
1261440000 seconds
>>>
40 years is:
14600 days
350400 hours
21024000 minutes
1261440000 seconds
>>>
How many years?22
22 years is:
8030 days
192720 hours
11563200 minutes
693792000 seconds
>>>
Can you please provide outputs also .
ReplyDeleteOk, I have updated it.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )