Mar-26-2019, 10:13 AM
In your current code:
Your first outer loop (line 10-13, second code block) writes out 'Sorry' for every uppercase vowel in your string (it ignores 'a' but catches 'A')
Your second outer loop (line 15-19) adds a letter to the list multiple times. The reason for this is the loop on line 16 which makes you examine every letter many times. Try to replace this with an 'if' statement instead testing if your character is in the vowels set or not.
In your last code block you have an error. You can use the 'in' operator with two strings to check if the first string is in the other. However, 'vowels' is not a string, you can check its type with
Hope this helps you a step closer.
Your first outer loop (line 10-13, second code block) writes out 'Sorry' for every uppercase vowel in your string (it ignores 'a' but catches 'A')
Your second outer loop (line 15-19) adds a letter to the list multiple times. The reason for this is the loop on line 16 which makes you examine every letter many times. Try to replace this with an 'if' statement instead testing if your character is in the vowels set or not.
In your last code block you have an error. You can use the 'in' operator with two strings to check if the first string is in the other. However, 'vowels' is not a string, you can check its type with
print(type(vowels)).
Hope this helps you a step closer.