File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 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
77def 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
You can’t perform that action at this time.
0 commit comments