Spaces:
No application file
No application file
Download App.py from mazeem123/Calculator_: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/mazeem123/Calculator_/resolve/main/App.py
- Command line
-
hf download hf://spaces/mazeem123/Calculator_/App.py
-
curl -L -o App.py https://huggingface.co/spaces/mazeem123/Calculator_/resolve/main/App.py
612 Bytes
| # Simple Calculator | |
| num1 = float(input("Enter first number: ")) | |
| num2 = float(input("Enter second number: ")) | |
| print("Select operation:") | |
| print("1. Add (+)") | |
| print("2. Subtract (-)") | |
| print("3. Multiply (*)") | |
| print("4. Divide (/)") | |
| choice = input("Enter choice (1/2/3/4): ") | |
| if choice == "1": | |
| print("Result:", num1 + num2) | |
| elif choice == "2": | |
| print("Result:", num1 - num2) | |
| elif choice == "3": | |
| print("Result:", num1 * num2) | |
| elif choice == "4": | |
| if num2 != 0: | |
| print("Result:", num1 / num2) | |
| else: | |
| print("Error: Division by zero not allowed") | |
| else: | |
| print("Invalid choice") |