simeonshopov

Vowels sum lists

Oct 14th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. text = input().lower()
  2. sum = 0
  3. vowels = ["a", "e", "i", "o", "u"]
  4. value = [1, 2, 3, 4, 5]
  5.  
  6. for char in text:
  7.   if char in vowels:
  8.     index = vowels.index(char)
  9.     sum += value[index]
  10.  
  11. print(sum)
Advertisement
Add Comment
Please, Sign In to add comment