1today_day = date.today()
2days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","sunday"]
3print("Today weekday is ",days[today_day.weekday()])
1>>> import datetime
2>>> datetime.datetime.today()
3datetime.datetime(2012, 3, 23, 23, 24, 55, 173504)
4>>> datetime.datetime.today().weekday()
54
1from datetime import datetime
2date_str='10-12-20'
3datetime_object = datetime.strptime(date_str, '%m-%d-%y')
4datetime_object.weekday()