Created
December 10, 2013 03:51
-
-
Save lizadaly/7885470 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> # 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