Skip to content

Aquí tienes una descripción más corta y simple: This is a **Python script** that calculates the **area of a circle** ($A = \pi r^2$). It asks the user for their name and the radius, validates the input to ensure it's a positive number, and allows for **repeated calculations**.

Notifications You must be signed in to change notification settings

luisbotteri/python-area-circle

Repository files navigation

⭕ Circle Area Calculator / Calculadora del Área del Círculo

English

Description

A simple Python command-line utility for calculating the area of a circle. The user is prompted to enter their name and the radius of the circle. The program handles invalid inputs (non-numeric or non-positive radius) and allows for multiple calculations in a single run.

Features

  • Calculates the area of a circle using the formula $A = \pi r^2$.
  • Includes input validation to ensure the radius is a positive number.
  • Allows the user to perform multiple calculations sequentially.
  • Uses the built-in math.pi for accurate $\pi$ value.

Prerequisites

  • Python 3.x installed on your system.

How to Run

  1. Save the code as a Python file (e.g., circle_area.py).
  2. Open your terminal or command prompt.
  3. Navigate to the directory where you saved the file.
  4. Run the script using the following command:
    python circle_area.py
  5. Follow the on-screen prompts to input the required values.

Español

Descripción

Una sencilla utilidad de línea de comandos en Python para calcular el área de un círculo. Se solicita al usuario que ingrese su nombre y el radio del círculo. El programa maneja entradas no válidas (radio no numérico o no positivo) y permite realizar múltiples cálculos en una sola ejecución.

Características

  • Calcula el área de un círculo utilizando la fórmula $A = \pi r^2$.
  • Incluye validación de entrada para asegurar que el radio sea un número positivo.
  • Permite al usuario realizar múltiples cálculos de forma secuencial.
  • Utiliza la constante math.pi integrada para un valor preciso de $\pi$.

Requisitos Previos

  • Python 3.x instalado en tu sistema.

Cómo Ejecutar

  1. Guarda el código como un archivo de Python (por ejemplo, calculadora_circulo.py).
  2. Abre tu terminal o símbolo del sistema.
  3. Navega hasta el directorio donde guardaste el archivo.
  4. Ejecuta el script usando el siguiente comando:
    python calculadora_circulo.py
  5. Sigue las indicaciones en pantalla para introducir los valores requeridos.

About

Aquí tienes una descripción más corta y simple: This is a **Python script** that calculates the **area of a circle** ($A = \pi r^2$). It asks the user for their name and the radius, validates the input to ensure it's a positive number, and allows for **repeated calculations**.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages