-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVowel Eater.py
40 lines (36 loc) · 1.21 KB
/
Vowel Eater.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Your program must:
ask the user to enter a word;
use user_word = user_word.upper() to convert the word entered by the user to upper case; we'll talk about the so-called string methods and the upper() method very soon - don't worry;
use conditional execution and the continue statement to "eat" the following vowels A, E, I, O, U from the inputted word;
print the uneaten letters to the screen, each one of them on a separate line.
Test your program with the data we've provided for you.
"""
# creat user input variable and make string upper case:
user_word = input().upper()
# loop through string:
for letter in user_word:
# check for letter 'A':
if letter == 'A':
# continue
continue
# check for letter 'E':
elif letter == 'E':
# continue
continue
# check for letter 'I':
elif letter == 'I':
# continue:
continue
# check for letter 'O':
elif letter == 'O':
# continue:
continue
# check for letter 'U':
elif letter == 'U':
# continue
continue
# else print remaining string: one letter per line
else:
# print statement:
print(letter, end = '\n')