Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def displ():
- res = ()
- def even_vowels(str1):
- no_vow = 0
- vowels = ('a', 'e', 'i', 'o','u')
- for i in str1:
- if i.lower() in vowels:
- no_vow += 1
- return (no_vow%2 == 0)
- with open("poem.txt") as file:
- L1 = file.readlines()
- for i in L1:
- words = i.split(" ")
- print(words)
- for j in words:
- if even_vowels(j):
- res += (j,)
- print("\nWords containing Even no. of Vowels :")
- for i in res:
- print(rf"'{i}'", end = " ")
- print("\nNumber of Words : ", len(res))
- displ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement