Why isn't my variable working?


#1



pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

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


#3

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


#4

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