Skip to content

Commit

Permalink
Create ch07_01_if.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MurphyWan authored Feb 3, 2017
1 parent acafa42 commit a1b7f56
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ch07_01_if.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
number = 23
guess = int(input('Enter an integer : '))

if guess == number:
print('Congratulations, bingo!') # New block starts here
print('(but you do not win any prizes!)') # New block ends here
elif guess < number:
print('No, it is a litter higher than that')
# you can do whatever you want in a block ...
else:
print('No, it is a letter lower than that')
# you must have guess > number to reach here
print('Done')
# That last statement is always executed, after the if statement is executed

0 comments on commit a1b7f56

Please sign in to comment.