''' Purpose: gain experience with if-elif-else ''' # report message based on day of week # Sunday: weekend day # Monday: start of school week # Tuesday: school day # Wednesday: school day # Thursday: school day # Friday: end of school week # Saturday: weekend day # get day of interest reply = input( 'Enter day of week: ' ) # put day in standard format - first letter capitalized, others lower case day = reply.strip() day = day.capitalize() # "mONday" becomes "Monday" (capitalize first letter) # day = reply.strip().capitalize() # alternatively could also be written as print( ) # analyze and report on day # Could have also done if (day == "Saturday") and elif (day == "Sunday) # Could have had three elifs for Tues, Wed, Thurs # if, elif, else is a structural thing with Python # It just looks better to test your conditions with if, elif, elif, else # to test different possibilities. # day == "Monday" or "Tuesday" ( THIS DOESNT WORK) # day == "Monday" or day == "Tuesday" (THIS WILL WORK - separate LOGICAL expressions) # or/and will separate logical expressions!!! # THIS IS IMPORTANT ^^^ if ( day in [ "Saturday", "Sunday" ] ): response = "weekend day" elif ( day == "Monday" ): response = "start of school week" elif ( day == "Friday" ): response = "end of school week" elif ( day in [ "Tuesday", "Wednesday", "Thursday" ] ): response = "school day" else: response = "invalid day"