Advertisement
dkyoseff

For Loop - Lab / 06. Vowels Sum

Jul 28th, 2022
1,081
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. text = (input())
  2.  
  3. tot_sum = 0
  4.  
  5. for name in range(0, len(text)):
  6.     if text[name] == "a":
  7.         tot_sum += 1
  8.     if text[name] == "e":
  9.         tot_sum += 2
  10.     if text[name] == "i":
  11.         tot_sum += 3
  12.     if text[name] == "o":
  13.         tot_sum += 4
  14.     if text[name] == "u":
  15.         tot_sum += 5
  16.  
  17. print(tot_sum)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement