please code in python Zeller's congruence is a method to determine the day of the week (e.g., Sunday, Monday, etc.) from a calendar date given the day (d), modified-month (m) and year (y): Note that all division operations in the formula above indicate integer, or truncated division. For example, should be read as (26 * (m + 1)) // 10, not (26 * (m + 1)) / 10. The modified-month value only applies to the months of January and February, which are counted as months 13 and 14 of the previous year: e.g., 13 = Jan, 14 = Feb, 3 = Mar, 4 = Apr, 5 = May, . . . 12 = Dec. For example, 2/21/2014 (Feb 21, 2014) would be represented as 14/21/2013. Also note, algebraic constructs like 26(m + 1) in the equation above must be translated to Python (i.e., 26 *(m + 1) ). Zeller's congruence gives the day of the week starting with 0 = Monday, 1 = Tuesday and so on. Write a program that will input a date as three separate integer values (month, day, and year) and return the day-of-the-week value as determined by Zeller's method. See the examples below. Example: Enter month: 2 Enter day: 28 Enter year: 2014 2/28/2014 is a Friday Enter month: 2 Enter day: 28 Enter year: 2000 2/28/2000 is a Monday Enter month: 2 Enter day: 29 Enter year: 2000 2/29/2000 is a Tuesday
please code in python
Zeller's congruence is a method to determine the day of the week (e.g., Sunday, Monday, etc.) from a calendar date given the day (d), modified-month (m) and year (y):
Note that all division operations in the formula above indicate integer, or truncated division. For example, should be read as (26 * (m + 1)) // 10, not (26 * (m + 1)) / 10. The modified-month value only applies to the months of January and February, which are counted as months 13 and 14 of the previous year: e.g., 13 = Jan, 14 = Feb, 3 = Mar, 4 = Apr, 5 = May, . . . 12 = Dec. For example, 2/21/2014 (Feb 21, 2014) would be represented as 14/21/2013. Also note, algebraic constructs like 26(m + 1) in the equation above must be translated to Python (i.e., 26 *(m + 1) ).
Zeller's congruence gives the day of the week starting with 0 = Monday, 1 = Tuesday and so on.
Write a program that will input a date as three separate integer values (month, day, and year) and return the day-of-the-week value as determined by Zeller's method. See the examples below.
Example:
Enter month: 2
Enter day: 28
Enter year: 2014
2/28/2014 is a Friday
Enter month: 2
Enter day: 28
Enter year: 2000
2/28/2000 is a Monday
Enter month: 2
Enter day: 29
Enter year: 2000
2/29/2000 is a Tuesday
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images