Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 72)
72.
How can you read a string from the console, count the number of vowels and consonants, and print the result?
vowel_consonant_count(input("Enter a string: "))
print(count_vowels_consonants(get_user_string()))
string_input = input("Enter a string: "); print("Vowels:", count_vowels(string_input), "Consonants:", count_consonants(string_input))
print("Vowels:", vowels_count(input("Enter a string: ")), "Consonants:", consonants_count(input()))
Answer: Option
Explanation:
To read a string from the console, count the number of vowels and consonants, and print the result, use string_input = input("Enter a string: "); print("Vowels:", count_vowels(string_input), "Consonants:", count_consonants(string_input)).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.