You are tasked with creating a Python script that counts the number of vowels in a given sentence. Your program should prompt the user to enter a sentence, and then output the total count of vowels present in that sentence. The program should treat both uppercase and lowercase vowels as equivalent.
Your task is to write a Python script that accomplishes this, utilizing functions and loops as necessary.
def count_vowels(sentence):
vowels = 'aeiouAEIOU'
vowel_count = 0
for char in sentence:
if char in vowels:
vowel_count += 1
return vowel_count
sentence = input("Enter a sentence: ")
print("Number of vowels:", count_vowels(sentence))
Enter a sentence: Hello I am a Sales Expert Number of vowels: 9
This script defines a function count_vowels that takes a sentence as input and returns the count of vowels in it. It iterates over each character in the sentence and checks if it is a vowel. If it is, it increments the count. Finally, it prints out the total count of vowels in the sentence.