Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. choice = input("Você quer calcular o cateto ou a hipotenusa? (C/H): ")
  2. if choice == "H" or choice == "h":
  3.         a = int(input("Digite o valor de um cateto: "))
  4.         b = int(input("Digite o valor de outro cateto: "))
  5.         c = (a*a + b*b)**0.5
  6.         print(f"A hipotenusa vale {c}.")
  7. elif choice == "C" or choice == "c":
  8.         a = int(input("Digite o valor de um cateto: "))
  9.         b = int(input("Digite o valor da hipotenusa: "))
  10.         c = (b*b - a*a)**0.5
  11.         print(f"O cateto vale {c}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement