I am a helpless Python Beginner:(

How the hell do I solve this exercise, what’s the code?? I don’t understand what it wants from me and how to solve it. This is an absolute beginner exercise, so nothing very complex is expected from me here.

# Days of week are numbered as: 0 — Sunday, 1 — Monday, 2 — Tuesday, ..., 6 — Saturday. An integer K in the range 1 to 365 is given. Find the number of day of week for K-th day of year provided that in this year January 1 was Thursday.  
# Example input
#1

#Example output
#4

# Read an integer:
# a = int(input())
# Print a value:
# print(a)

I don’t know what to try really and how to start solving this exercise:(

>Solution :

Here is the code:

days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
day_number = int(input("What day do you want to get: "))
day = days[day_number % 7]
print(f"Your day: {day}")

Leave a Reply