- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbool_ex.py
More file actions
Latest commit
30 lines (23 loc) · 524 Bytes
/
Copy pathbool_ex.py
File metadata and controls
30 lines (23 loc) · 524 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
#!usr/bin/env python
#import modules used here - sys is a very standard one
importsys
defis_even(num):
'''(int --> bool)
Return whether num is even.
>>> is_even(4)
True
>>> is_even(77)
False
'''
ifnum%2==0:
print("True", num)
else:
print("False", num)
defis_odd(num):
ifnum%2==0:
print("Even Number", num)
else:
print("Odd Number", num)
if__name__=='__main__':
is_even(76)
is_odd(77)