have syntax error while executing statement in python -
>>> x=5 >>> y=10 >>> if(x>y): ... print 'x greater': file "<stdin>", line 2 print 'x greater': ^ indentationerror: expected indented block
the error message says all. python uses indentation handle blocks, , since print
statement should inside if
's block, should indented:
>>> x=5 >>> y=10 >>> if(x>y): ... print 'x greater': # note indentation here
Comments
Post a Comment