-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_biggest.py
More file actions
32 lines (28 loc) · 773 Bytes
/
find_biggest.py
File metadata and controls
32 lines (28 loc) · 773 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
31
32
'''
Variables a, b and c have different values. Create a program that finds the biggest one. Show 3 different ways to solve the problem.
'''
a = int(input("Give a number:"))
b = int(input("Give a number:"))
c = int(input("Give a number:"))
# 1
if a >= b and a >= c:
print(f"{a} is the biggest number.")
elif b >= a and b >= c:
print(f"{b} is the biggest number.")
else:
print(f"{c} is the biggest number.")
# 2
if a > b:
if a > c:
print(f"{a} is the biggest number.")
else:
print(f"{c} is the biggest number.")
elif b > a:
if b > c:
print(f"{b} is the biggest number.")
else:
print(f"{c} is the biggest number.")
else:
print(f"{c} is the biggest number.")
# 3
print(max(a, b, c), "is the biggest number.")