-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifstmt.py
43 lines (33 loc) · 802 Bytes
/
ifstmt.py
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
31
32
33
34
35
36
37
38
39
40
41
#is_male = True
is_male = False
if is_male:
print('You are a male')
else:
print('You are not a male')
is_male = False
is_tall = True
#and operator
if is_male and is_tall:
print('You are a male and tall')
elif is_male and not(is_tall):
print('You are a male and not tall')
elif not(is_male) and is_tall:
print('You are not male and tall')
else:
print('You are not male and not tall')
is_male = False
is_tall = False
#or operator
if is_male or is_tall:
print('You are either male or tall')
else:
print('You are neither male nor tall')
def max_num(num1, num2, num3):
if num1 >= num2 and num1 >= num3:
return num1
elif num2 >= num1 and num2 >= num3:
return num2
else:
return num3
print(max_num(1,2,3))
print(max_num(230,120,1))