This repository was archived by the owner on Jun 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3age.py
More file actions
33 lines (33 loc) · 1.57 KB
/
Copy path3age.py
File metadata and controls
33 lines (33 loc) · 1.57 KB
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
a=int(input("enter age of first person: "))
b=int(input("enter age of first person: "))
c=int(input("enter age of first person: "))
if(a>b and a>c):
if(b>c):
print(f"1st person age {a} is the oldest and 3rd person age {c} is the youngest")
elif(c>b):
print(f"1st person age {a} is the oldest and 2nd person age {b} is the youngest")
elif(b==c):
print(f"1st person age {a} is the oldest and 2nd and 3rd person age {b} are the youngest")
elif(b>a and b>c):
if(a>c):
print(f"2nd person age {b} is the oldest and 3rd person age {c} is the youngest")
elif(c>a):
print(f"2nd person age {b} is the oldest and 1st person age {a} is the youngest")
elif(a==c):
print(f"2nd person age {b} is the oldest and 1st and 3rd person age {b} are the youngest")
elif(c>a and c>b):
if(a>b):
print(f"3rd person age {c} is the oldest and 2nd person age {b} is the youngest")
elif(b>a):
print(f"3rd person age {b} is the oldest and 1st person age {a} is the youngest")
elif(a==b):
print(f"3rd person age {c} is the oldest and 1st and 2nd person age {b} are the youngest")
else:
if(a==b and b>c):
print(f"1st and 2nd person age {a} are the oldest and 3rd person age {c} is the youngest")
elif(b==c and b>a):
print(f"2nd and 3rd person age {b} are the oldest and 1st person age {a} is the youngest")
elif(a==c and a>b):
print(f"1st and 3rd person age {a} are the oldest and 2nd person age {b} is the youngest")
elif(a==b and b==c):
print(f"all three people are of the same age {a}")