GUVI
Back

YOU GOT THIS | #WinACourseWednesday

Created 2 years ago
161 Views
7 Comments
tanishhky
@tanishhky
tanishhky
@tanishhkyProfile is locked. Login

Complete the given Python script wherever ??tags are there  that accept a day of the week (Sunday through Monday) as day and a number x. Determine what day of the week it will be x days after the given day. (Example: If day is Tuesday and x is 3 the result is Friday.)

 

?? day_of_week(day: str, k: int) -> ??:

days = [                        

        'monday',

        'tuesday',

        'wednesday',

        'thursday',

        'friday',

        'saturday',

        'sunday',

]

index = ??

for d in range(len(??)): 

     if days[d] == day: 

            index = d      

return days[(index ??) % 7]

 

if name == '__main__':

day = input("Please enter the present day to find the day after k days of your wish: ")

k = ??(input("Insert the K value: "))

res = day_of_week(day, k)

    print("The day after {} days from given day is {}".format(?,?))

Comments (7)
Please login to comment.
 
Powered by habitate.io Habitate