pyg = 'ay'
original = raw_input('Enter a word:')
word = original.lower()
first = word[0]
if len(original) > 0 and original.isalpha():
if first in 'aeiou':
print 'vowel'
else:
print "consonant"
else:
print "empty"
Python builds on identantion, meaning: The number of spaces from the left right before each code starts. Also, Each if
and else
must coexist on the same identation,
For instance:
if 1 == 1:
else:
Will not work, because there's 0 spaces before if
and there's 4 spaces befor else
.
So each else
that belongs to a if
statement must be on a veritical alignment.