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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -