We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92b2c86 commit aefab0bCopy full SHA for aefab0b
74/bday.py
@@ -0,0 +1,14 @@
1
+import calendar
2
+from datetime import date
3
+
4
5
+def weekday_of_birth_date(date):
6
+ """Takes a date object and returns the corresponding weekday string"""
7
+ d = date.weekday()
8
+ return calendar.day_name[d]
9
10
11
12
+# dt = date(1968, 9, 25)
13
+# print(weekday_of_birth_date(dt))
14
74/test_bday.py
@@ -0,0 +1,18 @@
+from bday import weekday_of_birth_date
+def test_leonardo_dicaprio_bday():
+ dt = date(1974, 11, 11)
+ assert weekday_of_birth_date(dt) == 'Monday'
+def test_will_smith_bday():
+ dt = date(1968, 9, 25)
+ assert weekday_of_birth_date(dt) == 'Wednesday'
15
16
+def test_robert_downey_bday():
17
+ dt = date(1965, 4, 4)
18
+ assert weekday_of_birth_date(dt) == 'Sunday'
0 commit comments