Computer Science, asked by vaibhavpatelclass11, 1 year ago

write a python program to convert the number of days into years months and remainning days.

Answers

Answered by Anonymous
29

Hi there

Here is your answer

______________________________________________________

n=int(input("Please enter Number of Days In a year"))

#assuming number of days is 365

year = int(n / 365)  

weeks = int((n % 365) /7)  

days = (n % 365) % 7  

print("years = ",year, "week = ",weeks,"days = ",days)

____________________________________________

Hope It Helps

Best of Luck

Please Mark My Answer as Brainliest Answer

Answered by Anonymous
5

A python program to convert the number of days into years months and remaining days is as follows:

week_days =7

def calculate( no_of_days ):

 

   year = int(no_of_days / 365)

   week = int((no_of_days % 365) /week_days)

         

   days = (no_of_days % 365) % week_days

     

   print("years are = ", year, "\nweeks are = ", week, "\ndays are = ", days)

     

Similar questions