I have a weekday integer (0,1,2...) and I need to get the day name (\'Monday\', \'Tuesday\',...).
Is there a built in Python function or way of doing this?
H
You can use built in functions for that for ex suppose you have to find day according to the specific date.
import calendar
month,day,year = 9,19,1995
ans =calendar.weekday(year,month,day)
print(calendar.day_name[ans])
calendar.weekday(year, month, day) - Returns the day of the week (0 is Monday) for year (1970–…), month (1–12), day (1–31).
calendar.day_name - An array that represents the days of the week in the current locale
for more reference -https://docs.python.org/2/library/calendar.html#calendar.weekday