[Solved] Python – How to determine number of day of week given the Weekday [closed]


Using calendar built-in library, you can handle it like this:

import calendar

s_day = raw_input()
days = list(calendar.day_name)

# days.index('Saturday') will print 5
print days.index(s_day)

Like this, the raw input must be in the correct format. Such as 'Monday' not 'MOnday'

solved Python – How to determine number of day of week given the Weekday [closed]