Skip to content

Commit df31428

Browse files
committed
Use the if statement
1 parent f58c248 commit df31428

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

if.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/python
2+
# Filename : if.py
3+
4+
number = 23
5+
guess = int(raw_input('Enter an integer : '))
6+
7+
if guess == number:
8+
print 'Congratulations, you guessed it.'
9+
print "(but you do not win any prizes!)"
10+
elif guess < number:
11+
print 'No, it is a little higher than that'
12+
else:
13+
print 'No, it is a little lower than that'
14+
15+
print 'Done'

0 commit comments

Comments
 (0)