generate functionFri, 05 May 2023

construya un algoritmo que dados como datos de la base y la altura de un triangulo, calcule e imprima el perimetro y el area

def area_triangle(base, height): area = (base * height) / 2 return area def perimeter(base, height): h = (base ** 2 + height ** 2) ** 1/2 perimeter = base + height + h return perimeter print(area_triangle(2, 3)) print(perimeter(2, 3))

Questions about programming?Chat with your personal AI assistant