Advertisement
teslariu

ejercicio python

May 4th, 2023
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. # Escribir un script que pida el radio de un círculo y devuelva
  5. # su area usando alguna funcion
  6. # area = pi * radio**2, pi=3.1416
  7. # Expresar el resultado con 2 cifras decimales
  8.  
  9. def calcularArea(radio):
  10.     return 3.1416 * radio ** 2
  11.  
  12.    
  13. entrada = float(input("INGRESE UN RADIO: "))
  14. print(f"Area: {calcularArea(entrada):.2f}")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement