Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- AmmntA = 0
- AmmntE = 0
- AmmntI = 0
- AmmntO = 0
- AmmntU = 0
- AmmntY = 0# go through each letter,
- if a letter is a vowel, add 1 to the corresponding vowel list.
- for x in st:
- if x == 'A'
- or x == 'a':
- AmmntA = AmmntA + 1
- elif x == 'E'
- or x == 'e':
- AmmntE = AmmntE + 1
- elif x == 'I'
- or x == 'i':
- AmmntI = AmmntI + 1
- elif x == 'O'
- or x == 'o':
- AmmntO = AmmntO + 1#
- if a word has no vowels, but has the letter Y in it, print another response.
- brokenupst = st.split()
- for x in brokenupst:
- 'a'
- not in x or 'A'
- not in x or 'e'
- not in x or 'E'
- not in x or 'i'
- not in x or 'I'
- not in x or 'o'
- not in x or 'O'
- not in x or 'u'
- not in x or 'U'
- not in x:
- #print out final lists of amount of vowels, also state "Your statement had __ A's in it."
- 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.")
- print(AmmntY)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement