Using for loops with strings
Q1. Enter this code and get it working:
myPhrase = input('Please enter a phrase with at least one word >>> ')
print('\n')
vowels='aeiou'
count = 0
for a in myPhrase:
print(a, end=' ')
if a in vowels:
count = count + 1
print('\n')
print('There are',count,'vowels in this phrase.')
input('Press <ENTER> to quit')
Q2. What does this program attempt to do?
Q3. Fully test that it counts vowels correctly. Use this phrase: 'Ants like bees'. Make any necessary modifications if you find a problem. Look up the string methods documentation if necessary.
Q4. Words in a phrase are separated by spaces. Modify your program so that it counts and displays the number of words in the phrase.
Q5. You are now required to modify your code so that it prints out each letter on its own line along with its ASCII code. It should report back on the number of vowels and the number of words at the end. you will need to find out how to convert a letter into its corresponding ASCII code in Python.
For example, if you typed in the phrase Ants like bees it should display:
