MINI-EXERCISE 1 Exercise A Write a while loop that repeatedly asks the user for a number until exactly 3 odd numbers have been given. QUESTION 1: You have a code that starts with the following lines – s = input("Give me a word: ") c = input("Give me a letter: ") Write a loop that checks if s contains any letter that occurs before c in the alphabet. Assume all letters in s and c are lowercase. Modify "contains" to be True or False depending on the above Hint: Remember that "a" < "b" < "c" ... in Python To get you started, try completing the code below: contains = False for char in s: # ... QUESTION 2: Solve the same question as above, using two other types of loops: 2.1: Write this using a for-range loop i.e. for i in range(...) 2.2: Write this using a while loop QUESTION 3: Which of your three solutions (from 1, 2.1, 2.2) do you like best and why? QUESTION 4: Write a modified solution (using any type of loop you want) that works even if the given word s and letter c could have mixture of uppercase and lowercase letters. I can no longer simply use "<" because recall that "D" < "a" is True even though "a" clearly occurs before "d" in the actual alphabet. Hint: Use one of the string methods to help you out.
Read less