Word up


I have a question.
Why do I have to put "word = original.lower()" and "first = word [0]" within if statement?
And why does it not work when I put codes above before if statement, even if replacing "len(original)" with "len(word)" along with "word.isalpha()"?
Does anyone have an answer? Help!

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word [0]
    print  first
    print 'empty'


Because these lines,

Are supposed to run only when this condition is met,


Thanks. I finally understood.


Awesome! :grin: also please read this post,


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.