repl.it
@AzureScripts/

Calculator

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
print("Welcome to the Calculator!")
print("Enter 2 numbers that you want to play with!")
num1 = int(input("Number 1: "))
num2 = int(input("Number 2: "))

print("What do you want to do with these numbers?")
print("1. Add\n2. Minus\n3. Divide\n4. Mulitply")
choice = input(">>> ")

if choice == "1":
    answer = num1 + num2
    print("The 2 numbers added together is", answer)
if choice == "2":
    answer = num1 - num2
    print(f"{num1} take away {num2} is", answer)
if choice == "3":
    answer = num1 / num2
    print(f"{num1} divide by {num2} is", answer)
if choice == "4":
    answer = num1 * num2
    print(f"{num1} * {num2} is", answer)
if choice > "4":
    print("Too high... not a valid choice")
?