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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -