satya

Tuesday, October 6, 2020

Program-8

                                                                                      

                                                                                Program-8

8) Write a program that asks the user to enter a word and prints out whether that                word contains  any vowels.


word=input("Enter the word:")

count=0

for i in word:

    if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or

       i=='A' or i=='E' or i=='I' or i=='O' or i=='U'):

            count=count+1

            break;

if(count==1):

    print("Word contain vowel")

else:

    print("Word contain not vowel")


OUTPUT:

>>>

== RESTART: D:\old\r19 lab-python\8.py =====

Enter the word: CRR

Word contain not vowel

>>> 

== RESTART: D:\old\r19 lab-python\8.py ======

Enter the word: CRR coe

Word contain vowel

>>> 

No comments:

Post a Comment

Program 30

                                                                         Program 30 Write a Python class to implement pow(x, n). class Pow1:...