''' Purpose: use if-else statement ''' # is the first value in the input text a vowel? # define helpful constant VOWELS = "aeiou" # get input text and put into canonical form text = input( 'Enter text: ' ) text = text.strip() text = text.lower() # lower because all of the characters in VOWELS is lowercase # we want to evaluate whether the first character is a vowel regardless of case # determine its first character first_character = text[0] print( 'first_character =', first_character ) # determine whether first character is a vowel --> need if/else statement? # look in first char --> look in VOWELS --> if first char in VOWELS # if it is in VOWELS (then first char is a vowel): then print yes? # otherwise (not in VOWELS) : then print no? if ( first_character in VOWELS ): # first_character IS a vowel # first_character is SINGLE character # VOWELS is a STRING of length 5 (5 characters) # therefore, first_character is NEVER == to VOWELS # we want to know whether first_character is IN VOWELS # in: take a substring and check whether that substring/char is in the second string print( 'yes' ) # print( 'almost done' ) else: # first_character is NOT a vowel print( 'no' ) # DO NOT have other things unindented BETWEEN if and else; comments are ok # else needs to follow an if, cannot be by itself (dangling else) print( 'all done' )