Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. st = input('Tell me something and I will tell you how many of each vowel there are in your statement: ')# starting values of number of values = 0
  2. AmmntA = 0
  3. AmmntE = 0
  4. AmmntI = 0
  5. AmmntO = 0
  6. AmmntU = 0
  7. AmmntY = 0# go through each letter,
  8.   if a letter is a vowel, add 1 to the corresponding vowel list.
  9. for x in st:
  10.   if x == 'A'
  11. or x == 'a':
  12.   AmmntA = AmmntA + 1
  13. elif x == 'E'
  14. or x == 'e':
  15.   AmmntE = AmmntE + 1
  16. elif x == 'I'
  17. or x == 'i':
  18.   AmmntI = AmmntI + 1
  19. elif x == 'O'
  20. or x == 'o':
  21.   AmmntO = AmmntO + 1#
  22. if a word has no vowels, but has the letter Y in it, print another response.
  23. brokenupst = st.split()
  24. for x in brokenupst:
  25.   'a'
  26. not in x or 'A'
  27. not in x or 'e'
  28. not in x or 'E'
  29. not in x or 'i'
  30. not in x or 'I'
  31. not in x or 'o'
  32. not in x or 'O'
  33. not in x or 'u'
  34. not in x or 'U'
  35. not in x:
  36.  
  37.   #print out final lists of amount of vowels, also state "Your statement had __ A's in it."
  38. print("Your statement has " + str(AmmntA) + " A's in it,\n" + str(AmmntE) + " E's in it,\n" + str(AmmntI) + " I's in it,\n" + str(AmmntO) + " O's in it, and\n" + str(AmmntU) + " U's in it.")
  39. print(AmmntY)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement