142k views
4 votes
Write a program that takes a sentence as input and prints all the vowels in the sentence. Your program must use a for loop. Sample output: C:\>: python basic_for.py Enter a sentence: the cat was very cute.

User Flashpunk
by
4.8k points

1 Answer

1 vote

Answer:

Python.

Step-by-step explanation:

// Ask user for input string and store it to variable

sentence = input("Enter a sentence: ")

// Loop through each character in string

for character in sentence:

// Check for vowel

if character == 'a' or character == 'e' or character == 'i' or character == 'o' or character == 'u':

// print the vowel

print(letter)

User Brian Luft
by
4.1k points