How can I write down something in the if statement without losing the real semantic of it?


How can I write down those variable inside of the if statement?
I can't just put it there, right?

pyg = 'ay'

original = raw_input('Enter a word:')

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


Python does things in indents. And semicolons aren't really used in Python either (that's more of a javascript thing). So whatever you need to do in the if statement should be indented beneath it such as:

if 3 < 4 and 5 > 3:
    foo = random_word.lower()
    print foo


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