Created
October 13, 2013 09:10
-
-
Save Alir3z4/6960085 to your computer and use it in GitHub Desktop.
Ahmad gist
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
| # Filename : if.py | |
| number = 23 | |
| guess = int(raw_input('Enter an integer : ')) | |
| if guess == number: | |
| print "Congratulations, you guessed it." # New block starts here | |
| print "(but you do not win any prizes!)" # New block ends here | |
| elif guess < number: | |
| print "No, it is a little higher than that" # Another block | |
| # You can do whatever you want in a block ... | |
| else: | |
| print 'No, it is a little lower than that' | |
| # you must have guess > number to reach here | |
| print 'Done' | |
| # This is last statement always excuted, after the if statement excuted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment