Please help me to use python write this question thanks Give

Please help me to use python write this question, thanks.

Given a string as input, count the vowels and return the result. The given string may be upper or lower case, and \'Y\' is not considered a vowel.

Solution

# Python Program                   

while True:

                print(\"Enter \'x\' for exit.\")

                string = input(\"Enter any string: \")

                if string == \'x\':

                                break

                else:

                                vowels = \'aeiou\'

                                string = string.casefold()

                                count = {}.fromkeys(vowels,0)

                                for char in string:

                                                if char in count:

                                                                count[char] += 1

                                print(count,\"\ \")

Please help me to use python write this question, thanks. Given a string as input, count the vowels and return the result. The given string may be upper or lowe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site