diff --git a/Simple Command-Line Calculator b/Simple Command-Line Calculator new file mode 100644 index 0000000..8f4268b --- /dev/null +++ b/Simple Command-Line Calculator @@ -0,0 +1,17 @@ +def calculator(): + operation = input("Choose operation (+, -, *, /): ") + num1 = float(input("Enter first number: ")) + num2 = float(input("Enter second number: ")) + + if operation == '+': + print(num1 + num2) + elif operation == '-': + print(num1 - num2) + elif operation == '*': + print(num1 * num2) + elif operation == '/': + print(num1 / num2) + else: + print("Invalid operation") + +calculator()