Created
November 2, 2012 05:00
-
-
Save felquis/3998807 to your computer and use it in GitHub Desktop.
If e else if em Python
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
# Um tipico if no Python | |
if (1 < 2) : | |
print "Menor que 2" | |
# Um tipico if com else no Python | |
if (2 == 1) : | |
print "Igual \o/" | |
else : | |
print "Não é igual :(" | |
# Um if, com else if e else no Python | |
Number = 98; | |
if (Number == 101) : | |
print 100 | |
elif (Number == 100) : | |
print 'Nop' | |
elif (Number == 99) : | |
print 'Tambem nao' | |
else : | |
print Number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment