-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexercise_21.py
More file actions
30 lines (25 loc) · 763 Bytes
/
exercise_21.py
File metadata and controls
30 lines (25 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
print(
'-----------------------------------------\n'\
'Practical python education || Exercise-21:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user."\n'
)
print(
'Solution:\n'\
'-----------------------------------------'\
)
num = int(input("Enter a number = "))
mod = num % 2
if mod > 0:
print("This is an odd number!")
else:
print("This is an even number!")
print(
'\n-----------------------------------------\n'\
'Copyright 2018 Vladimir Pavlov. All Rights Reserved.\n'\
'-----------------------------------------'
)