Skip to content

Commit 655d1df

Browse files
added comments
1 parent ceab410 commit 655d1df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Day_of_week.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Python program to Find day of
22
# the week for a given date
3-
import calendar
4-
import datetime
3+
import calendar #module of python to provide useful fucntions related to calendar
4+
import datetime # module of python to get the date and time
55

66

77
def findDay(date):
8-
born = datetime.datetime.strptime(date, '%d %m %Y').weekday()
9-
return (calendar.day_name[born])
8+
born = datetime.datetime.strptime(date, '%d %m %Y').weekday() #this statement returns an integer corresponding to the day of the week
9+
return (calendar.day_name[born]) #this statement returns the corresponding day name to the integer generated in the previous statement
1010

1111

1212
# Driver program
13-
date = '03 02 2019'
14-
print(findDay(date))
13+
date = '03 02 2019' #this is the input date
14+
print(findDay(date)) # here we print the final output after calling the fucntion findday

0 commit comments

Comments
 (0)