Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

urgently need help!!

0 votes
asked Feb 25, 2019 by anonymous
Write TWO (2) separate Python functions named convertDayi() and convertDayii() for parts (i) and (ii) respectively.
Each function prompts a user to enter a number which represents a duration in days. Assume that a year has 365 days and a month has 30.41 days.
i) Suppose the user will enter only positive whole numbers. Print the result in the format as shown in the example run below (characters in green are user input):
An example run:
Enter time in days: 1350
3 year 8 month 11 day

1 Answer

0 votes
answered Mar 1, 2019 by anonymous
def find( number_of_days ):

    year = int(number_of_days / 365)

    week = int((number_of_days % 365) /

                DAYS_IN_WEEK)

    days = (number_of_days % 365) % DAYS_IN_WEEK

       print("years = ",year,

          "\nweeks = ",week,

          "\ndays = ",days)

number_of_days = 200

find(number_of_days)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...