Created
September 20, 2014 21:06
-
-
Save BlackVegetable/a1e26ee6598cdffc44be to your computer and use it in GitHub Desktop.
An example of proper and improper indentation of if statements.
This file contains 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
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