pythagorean theorem python
distance = math.sqrt((abs(distancex) ** 2) + (abs(distancey) ** 2))
pythagorean theorem python
distance = math.sqrt((abs(distancex) ** 2) + (abs(distancey) ** 2))
pythagoras python
import math
input1 = input('What do you want to find: ')
def c():
inputA = float(input('Enter a: '))
inputB = float(input('Enter b: '))
fc = math.sqrt(inputA ** 2 + inputB ** 2)
print(f'c = {round(fc, 3)}')
def ab(t, ans):
inputB = float(input(f'Enter {t}: '))
inputC = float(input('Enter c: '))
if inputC > inputB:
a = math.sqrt(inputC ** 2 - inputB ** 2)
print(f'{ans} = {round(a, 3)}')
else:
print('Invalid input')
if input1 == 'c':
c()
elif input1 == 'a':
t = 'b'
ans = 'a'
ab(t, ans)
elif input1 == 'b':
t = 'a'
ans = 'b'
ab(t, ans)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us