GCK

GCK/Calculate hypotenuse

GCK
Sep 12th, 2019
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2. print("Hi, I'm gigi, your bot.")
  3.  
  4. users_name=input("What's your name dude ?: ")
  5. print("Welcome "+users_name+ ".Let's calculate the hypotenuse of a right triangle")
  6.  
  7. print("Enter first the a and b lengths of your triangle ")
  8.  
  9. input1=input("a is : ")
  10. input2=input("b is : ")
  11. a=float(input1)
  12. b=float(input2)
  13. square_a=math.pow(a,2)
  14. square_b=math.pow(b,2)
  15. result=math.sqrt(square_a + square_b)
  16. print(result)
  17. output=str(result)
  18. print("The hypotenuse of a triangle of lengths ( a= " + input1 + ", b= " + input2 + ") is " + output)
Add Comment
Please, Sign In to add comment