
George D. answered 07/31/20
Tutor
4.9
(10)
Computer Science Student at the University of Central Florida
import datetime
def printWeekdayName(year, month, day):
target = datetime.datetime(year, month, day) # gets the day as a datetime object
weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] # list of days of the week
print(weekdays[target.weekday()]) # gets the day of the week from the target day and prints it