calculator
James193 (8)

import time
addvariable = input("Give me a number")
addnumber = input("give me a second number")
print("your answer is...")
time.sleep(1)
print(addnumber + addvariable)

timesvariable = input("give me a number")
timesnumber = input("give me a second number")
print("your answer is...")
time.sleep(1)
print(timesvariable * timesnumber)
why cant i get my code to multiply or add???!!!!

You are viewing a single comment. View All
Answered by ReshiramWolfu (62) [earned 5 cycles]
View Answer
James193 (8)

@ReshiramWolfu here is the full version of my code now thanks to you!!!:)

while True:
timesvariable = int()
addvariable = int()
timesnumber = int()
addnumber = int()
divisionnumber = int()
divisionvariable = int()
subnumber = int()
subvariable = int()
mat = bool()
import time
mat = input("what would you like to do???, 1 = addition, 2 = multiplication, 3 = division or 4 = subtraction or break if you want to exit the calculator")
if mat == "1":
addvariable = int(input("Give me a number"))
addnumber = int(input("give me a second number"))
print("your answer is...")
time.sleep(1)
print(addnumber + addvariable)
elif mat == "2":
timesvariable = int(input("give me a number"))
timesnumber = int(input("give me a second number"))
print("your answer is...")
time.sleep(1)
print(timesnumber * timesvariable)
elif mat == "3":
divisionvariable = int(input("give me a number"))
divisionnumber = int(input("give me a second number"))
print("your answer is...")
time.sleep(1)
print(divisionvariable / divisionnumber)
elif mat == "4":
subvariable = int(input("give me a number"))
subnumber = int(input("give me a second number"))
print("your answer is...")
time.sleep(1)
print(subvariable - subnumber)
elif mat == "break":
break