Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajtilak-2020/python_calculator

This Python script creates a simple interactive REPL (Read-Eval-Print Loop). It continuously prompts the user for input, evaluates the input as a Python expression using eval(), and prints the result.
https://github.com/rajtilak-2020/python_calculator

calculator coding project python

Last synced: 13 days ago
JSON representation

This Python script creates a simple interactive REPL (Read-Eval-Print Loop). It continuously prompts the user for input, evaluates the input as a Python expression using eval(), and prints the result.

Awesome Lists containing this project

README

        

# 🎨 **Interactive Python REPL** 🐍

This lightweight script offers a simple, intuitive interface for evaluating Python expressions on the fly.

---

## 🌟 **Features**

- 🔄 **Infinite Loop**: Continuously evaluates Python expressions until you choose to exit.
- 🧠 **Dynamic Evaluation**: Supports any valid Python expression with instant results.
- ⚡ **Lightweight and Fast**: Minimalistic design for maximum efficiency.
- 🎮 **Interactive**: Get immediate feedback for your inputs.

---

## 🚀 **How It Works**

The script operates as a **Read-Eval-Print Loop (REPL)**:
1. 🖥️ Prompts you to enter a Python expression.
2. 🤖 Dynamically evaluates the input using Python's built-in `eval()`.
3. 📢 Displays the result of the evaluation.

**Example:**

```plaintext
>>> 5 + 7
12
>>> "Hello, " + "world!"
Hello, world!
>>> [x**2 for x in range(5)]
[0, 1, 4, 9, 16]