Quote:
a program that asks the user
for the number of lines for the entered poem.
This means that
user input is sentences,which imply that input contains non letters like spaces, commas or points.
if (i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u'
or i == 'A' or i == 'E' or i == 'I' or i == 'O' or i == 'U'):
vowels = vowels + 1
else:
consonants = consonants + 1
So, what is not a vowel is not necessary a consonant, you need to check if a char is a consonant, or not.