| about | help | code help+videos | done | prefs |
Return the day of the month for US Thanksgiving of year (> 1999). US Thanksgiving occurs on the fourth Thursday of November. def thanksgiving(year):
"""Return day of month in November on which USA Thanksgiving falls."""
YEAR = 2000; # first valid year for this method
NOV1 = 3; # 2000/11/01 falls on a Wednesday
THURSDAY = 4; # (Sun = 0, Mon = 1, ..., Sat = 6)thanksgiving(2000) → 23 thanksgiving(2001) → 22 thanksgiving(2002) → 28 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 50
Copyright Nick Parlante 2017 - privacy