Calculate Right Triangle Hypotenuse Length

  • Share this:

Code introduction


Calculate the length of the hypotenuse of a right triangle.


Technology Stack : math (mathematical operations)

Code Type : Mathematical calculation

Code Difficulty : Intermediate


                
                    
import math
import os
import re
import subprocess
import sys

def calculate_hypotenuse(a, b):
    return math.sqrt(a**2 + b**2)