In: Computer Science
Python
>>> noVowel('crypt')
True
>>> noVowel('cwm')
True
>>> noVowel('car')
False
Your function source code is like below:-
def noVowel(str):
flag=0
for letter in str:
if letter=='a' or letter=='e' or
letter=='i' or letter=='o' or letter=='u' :
flag=1
break
if flag==1:
return False
else:
return True
For testing purpose, you can use below code and save that in the file ("Saved file name with str.py") and run according to the below screenshot:
def noVowel(str):
flag=0
for letter in str:
if letter=='a' or letter=='e' or
letter=='i' or letter=='o' or letter=='u' :
flag=1
break
if flag==1:
return False
else:
return True
name = input('Enter a word:')
print (noVowel(name))
Hope so this will solve your problem.