Skip to content

Commit 6031614

Browse files
authored
Create number_analyzer.py
1 parent e87d09f commit 6031614

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

number_analyzer.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Starting Out with Python (4th Edition).
2+
# Tony Gaddis.
3+
# Chapter:3
4+
# Q.1 Number Analyzer.
5+
6+
print("Enter An Integer: ", end=" ")
7+
x = int(input())
8+
9+
if x > 0:
10+
print("Positive.")
11+
if x%2 == 0:
12+
print("Even.")
13+
14+
else:
15+
print("Odd.")
16+
17+
elif x < 0:
18+
print("Negative.")
19+
if x%2 == 0:
20+
print("Even.")
21+
22+
else:
23+
print("Odd.")
24+
25+
else:
26+
print("Zero.")
27+
print("Even.")

0 commit comments

Comments
 (0)