1import math
2
3input1 = input('What do you want to find: ')
4
5
6def c():
7 inputA = float(input('Enter a: '))
8 inputB = float(input('Enter b: '))
9 fc = math.sqrt(inputA ** 2 + inputB ** 2)
10 print(f'c = {round(fc, 3)}')
11
12
13def ab(t, ans):
14 inputB = float(input(f'Enter {t}: '))
15 inputC = float(input('Enter c: '))
16 if inputC > inputB:
17 a = math.sqrt(inputC ** 2 - inputB ** 2)
18 print(f'{ans} = {round(a, 3)}')
19 else:
20 print('Invalid input')
21
22
23 if input1 == 'c':
24 c()
25
26 elif input1 == 'a':
27 t = 'b'
28 ans = 'a'
29 ab(t, ans)
30
31 elif input1 == 'b':
32 t = 'a'
33 ans = 'b'
34 ab(t, ans)