Bryce H.

asked • 01/23/23

How to do a for loop to do this

#3.2 Find the vowels – for loop (4.5 points)

Using the 'if' statement and the 'or' operator, write a program that uses the input() function and asks the user for a word or sentence.

Print the number of vowels in the string that’s returned from the input() function.

Use the 'or' operator inside the 'if' condition.

Pseudo code:
Prompt user for a word or phrase.
total = 0
enter 'for' loop:
for each letter, check if the letter is an 'a,e,i,o or u'.
If a match, then +1 to total.
end loop.
Print total results.

1 Expert Answer


Ebony C. answered • 01/24/23

4.8 (21)

Current software developer with 4+ years of professional experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.