Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 1, 2020 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/0797f78bd8dad69dc30b1ae88d859bc1 to your computer and use it in GitHub Desktop.
Save parzibyte/0797f78bd8dad69dc30b1ae88d859bc1 to your computer and use it in GitHub Desktop.
import math
def area_triangulo(base, altura):
return base * altura / 2
def area_rectangulo(base, altura):
return base * altura
def area_rombo(diagonal1, diagonal2):
return (diagonal1 * diagonal2) / 2
def area_circulo(radio):
return math.pi * radio ** 2
print("Área de triángulo: ")
print(area_triangulo(2, 4))
print("Área de rectángulo: ")
print(area_rectangulo(8, 2))
print("Área de rombo: ")
print(area_rombo(23, 44))
print("Área de círculo: ")
print(area_circulo(7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment