Skip to content

Instantly share code, notes, and snippets.

@BlackVegetable
Created September 20, 2014 21:06
Show Gist options
  • Save BlackVegetable/a1e26ee6598cdffc44be to your computer and use it in GitHub Desktop.
Save BlackVegetable/a1e26ee6598cdffc44be to your computer and use it in GitHub Desktop.
An example of proper and improper indentation of if statements.
def returnOneOrTwo (self, value):
if value is 1:
return 1
if value is 2:
return 2
print "Oh no! I didn't handle this case!"
return 12 # Haha!
def badSyntax (self):
if self.hungry:
if self.angry:
print "I didn't indent properly so this code will not execute properly!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment