Why isn't my variable working?


pyg = 'ay'

original = raw_input('Enter a word:')

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


Hey @htmlpythonsource :slight_smile:

You source code looks fine other than a few little syntax errors. Originally, your variable works just fine.
But the initialization operators in the if statement needs to be a EQUALITY operators '=='.
And there needs to be the 'and' boolean operator between original.lower and first, word[0] and len(original).

I hope this helps!! Have a good day


word is not defined. Validate the input, original without involving other variables. Once the orginal input is validated, then define word according to instructions.


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