File tree 3 files changed +29
-0
lines changed 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Python program to Find day of
2
+ # the week for a given date
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
5
+
6
+
7
+ def findDay (date ):
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
10
+
11
+
12
+ # Driver program
13
+ date = input () #this is the input date
14
+ print (findDay (date )) # here we print the final output after calling the fucntion findday
15
+
16
+ #__author__ = Gautam Kumar Jaiswal
Original file line number Diff line number Diff line change
1
+ # DAY OF WEEK
2
+
3
+ This is a python script, that find day of the week for a given date.
4
+
5
+ ### Dependencies
6
+ * calender
7
+ * datetime
8
+
9
+ ### How to run?
10
+ > py Day_of_week.py
11
+
12
+ ### Snapshot
13
+ ![ snapshot] ( snapshot.PNG )
You can’t perform that action at this time.
0 commit comments