Ask Question
3 November, 13:43

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.

+2
Answers (1)
  1. 3 November, 15:27
    0
    Python.

    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)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “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: ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers