AnkitWebLogic

Convert in hours and minutes | Python

Exercise 14: WAP to input minutes and convert in hours and minutes. 1

# Input minutes and convert in hours and minutes | ankitweblogic.com
t=int(input("Enter total number of days: "))
y = t//365
t = t%365
m = t//30
t = t%30
w = t//7
d = t%7
print("Years =",y)
print("Months =",m)
print("Weeks =",w)
print("Days =",d)
Enter total number of days: 500
Years = 1
Months = 4
Weeks = 2
Days = 1

Advertisement