Skip to content

Commit 23e6d11

Browse files
author
ashegde
committed
feat(examples): conditions
1 parent 35db9df commit 23e6d11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

codes/session_2/condition.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Open terminal > python3 condition.py
2+
# Start typing below commands and see the output
3+
4+
x = int(input('Please enter an integer: '))
5+
6+
if x < 0:
7+
print(str(x) + ' is a negative number')
8+
elif x == 0:
9+
print(str(x) + ' is zero')
10+
else:
11+
print(str(x) + ' is a positive number')

0 commit comments

Comments
 (0)