Q:

Python program to accept the strings which contains all vowels

belongs to collection: Python String Programs

0

Accepting strings containing all vowels in Python

We will take a string as input from the user and then return YES or NO based on the presence of all vowels in the string.

Example:

Input:
"inlcudehelp"
Output:
No
Explanation:
The string does not contain 'a' and 'o' vowels. 

Input:
"IamReadingourBook"
Output:
Yes

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program to accept a string containing all vowels

# Python program to check if the string 
# contains all vowels or not

# Getting string input from the user 
myStr =  input('Enter the string : ')

# Checking if the string contains all vowels or not
myStr = myStr.lower()
allVowels = set("aeiou")

for char in myStr :
    if char in allVowels :
        allVowels.remove(char)

print("Entered String is ", myStr)
if len(allVowels) == 0:
    print("The string contains all vowels")
else :
    print("The string does not contain all vowels")

Output:

RUN 1:
Enter the string : IncludeHelp
Entered String is  includehelp
The string does not contain all vowels

RUN 2:
Enter the string : I am reading our book
Entered String is  i am reading our book
The string contains all vowels

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python String Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Python program to find the least frequent characte... >>
<< Python program to find the length of a string (dif...