Skip to content

Instantly share code, notes, and snippets.

@lizadaly
Created December 10, 2013 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizadaly/7885470 to your computer and use it in GitHub Desktop.
Save lizadaly/7885470 to your computer and use it in GitHub Desktop.
>>> # I'm going to set the variable 'items' first just for this demo
>>> items = 0
>>> if items > 5:
... print "Shipping is free" # This is going to cause a problem because it's not indented
File "<stdin>", line 2
print "Shipping is free"
^
IndentationError: expected an indented block
>>> # Oops, I wanted to indent that second line!
>>> if items > 5:
... print "Shipping is free" # I've indented this with a few spaces
... else:
... print "Sorry, you have to pay for shipping" # Make sure you always use the same number of spaces!
... # Now the message will print out as expected!
Sorry, you have to pay for shipping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment