สถานะการส่งล่าสุด: -

SOS11: lambda 01

lambda 01

Write a lambda function that calculates the hypothenuse of a right triangle given lengths of other two sides.

import math
# This lambda function will take 2 arguments as each side of triangle.
hypothenuse = lambda : 
h1 = hypothenuse(3, 4) #5.0
h2 = hypothenuse(6, 8) #10.0
print(h1, h2)