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
ReshiramWolfu (62)

@James193 here is the fixed version...
timesvariable = int()
addvariable = int()
timesnumber = int()
addnumber = int()
mat = bool()
import time
mat = input("what would you like to do???, True = addition, False = multiplication")
if mat == True:
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 == False:
timesvariable = int(input("give me a number"))
timesnumber = int(input("give me a second number"))
print("your answer is...")
time.sleep(1)
print(timesvariable * timesnumber)