Mid2 10th_Vowels_Spaces_Longest_word
v = ['a','e','i','o','u']
count_vowels=0
count_spaces=0
string = "this is ubaidi"
for i in string:
if i in v:
count_vowels+=1
elif i==" ":
count_spaces+=1
print(count_vowels)
print(count_spaces)
k=string.split()
largest=k[0]
for i in k:
if len(i)>len(largest):
largest=i
print(largest)
#output:
6
2
ubaidi
Comments
Post a Comment