1.

Write a python program code ,input a string and count number of vowels?

Answer» string=input("Enter a string :")a=[]for i in string: 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": a.append(i)print("There are",len(a),"vowels in",string)<br>n = str(input("Enter a string :")).lower()count =0for i in range(len(str)): if (n[i]=\'a\' or n[i]=\'e\' or n[i]==\'i\' or n[i]==\'o\' or n[i] == \'u\'): count+=1print(count)


Discussion

No Comment Found