Answer to Question #349927 in Python for Darkninja

Question #349927

# Accept string input.

# Count vowel and consonant characters in the string.

# Display the string in reverse order.



1
Expert's answer
2022-06-13T08:27:20-0400
inp_string = str(input())

VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'

number_of_vowels = 0
for i in range(5):
    number_of_vowels += inp_string.count(VOWELS[i])
#print(number_of_vowels)
number_of_consonants = 0
for i in range(21):
    number_of_consonants += inp_string.count(CONSONANTS[i])
#print(number_of_consonants)
print(inp_string[::-1])

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS