Method: calendar.weekday
Calls: 218, Exceptions: 0, Paths: 2Back
Path 1: 193 calls (0.89)
2004 (103) 2017 (27) 9999 (15) 1 (14) 2001 (2) 1995 (2) 1987 (2) 1988 (2) 1999 (2) 1923 (2)
12 (38) 1 (27) 2 (26) 4 (20) 5 (12) 3 (10) 6 (10) 7 (10) 8 (10) 9 (10)
1 (193)
0 (43) 2 (39) 3 (34) 6 (29) 5 (18) 4 (16) 1 (14)
1def weekday(year, month, day):
2 """Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
3 if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
4 year = 2000 + year % 400
5 return datetime.date(year, month, day).weekday()
Path 2: 25 calls (0.11)
0 (25)
2 (3) 1 (2) 3 (2) 4 (2) 5 (2) 6 (2) 7 (2) 8 (2) 9 (2) 10 (2)
1 (25)
5 (6) 1 (5) 2 (4) 4 (4) 0 (2) 3 (2) 6 (2)
1def weekday(year, month, day):
2 """Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
3 if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
4 year = 2000 + year % 400
5 return datetime.date(year, month, day).weekday()