Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def calculate _ weekday ( first _ day _ weekday, day _ of _ year,is _ leap _ year ) : if is _ leap

def calculate_weekday(first_day_weekday, day_of_year,is_leap_year):
if is_leap_year and day_of_year >59:
day_of_year +=1
weekday_number =(first_day_weekday + day_of_year -1)%7
return weekday_number
def get_user_input():
first_day_weekday = int(input("Enter the weekday number of the first day of the year (0-6): "))
day_of_year = int(input("Enter the day number of the year (1-365/366): "))
return first_day_weekday, day_of_year
def main():
year = int(input("what year is it?"))
first_day_weekday, day_of_year = get_user_input()
weekday_number = calculate_weekday(first_day_weekday, day_of_year,(year %4))
print(f"That will be weekday number: {weekday_number}")
main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is a job analysis?

Answered: 1 week ago

Question

What are the main provisions of the Fair Labor Standards Act?

Answered: 1 week ago