Created
October 26, 2016 03:44
-
-
Save hatak/be378599fb765b5173972ae903e5637b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y = int(input("Please input year: ")) | |
m = int(input("Please input month: ")) | |
d = int(input("Please input day: ")) | |
step1 = y + (y // 4) | |
step2 = step1 - (y // 100) | |
step3 = step2 + (y // 400) | |
step4 = (m * 13 + 8) // 5 | |
step5 = step3 + step4 | |
step6 = step5 + d | |
step7 = step6 % 7 | |
if step7 == 0: | |
print("Sunday") | |
elif step7 == 1: | |
print("Monday") | |
elif step7 == 2: | |
print("Tuesday") | |
elif step7 == 3: | |
print("Wednesday") | |
elif step7 == 4: | |
print("Thursday") | |
elif step7 == 5: | |
print("Friday") | |
elif step7 == 6: | |
print("Saturday") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment