Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created October 13, 2013 09:10
Show Gist options
  • Select an option

  • Save Alir3z4/6960085 to your computer and use it in GitHub Desktop.

Select an option

Save Alir3z4/6960085 to your computer and use it in GitHub Desktop.
Ahmad gist
# 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