我如何用python编写一个程序,它可以根据输入数据在数分钟和数小时内给我我的年龄,就像我在数年内给该程序以我的年龄,它将变成小时和分钟。
years = int(input("How old are you? "))
days = years * 365.25
hours = days * 24
minutes = hours * 60
seconds = minutes * 60
然后,您可以输出这些变量。
一天= 24小时
一小时= 60分钟
一分钟= 60秒
因此,一年是365 x 24 = 8,760 + 6 = 8,766小时
8,766小时x 60 = 525,960分钟
525,960 x 60 =每年31,557,600秒
based on the user input, do the necessary calculation to convert it to hours/minutes in your program