Ask 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: C:/>: python basic_for. py Enter a sentence: the cat was very cute.

+1
Answers (1)
  1. 28 December, 22:46
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers