- 1
Help on how to create a simple calculator
Write a program to take two integers as input and output their sum. Sample input: 2, 8 Sample output: 10
8 Answers
+ 6
Anonymous ,
i suppose this question is relared to ths *python core* tutorial. (exercise17)
all coding for code coach exercises can not have any user prompt inside the input() function. if this is not taken into account, the code will not pass the test cases.
also all additional output that is not requested will create errors when running the code.
+ 4
https://code.sololearn.com/cfao0DfmqtTq/?ref=app
Patrickson Unzima
Your code just get one number and it is printed...
Print Statement should be like this
print (num)...
Go through python beginners course for better understanding..
+ 2
Post your tried code..
+ 2
Anonymous that's hard coded and not what the question asks, you need to take two inputs.
+ 1
Ausgrindtube if we have to take input and enter the data by user, then code will be:-
a = int(input("Enter the number 1:")
b = int(input("Enter the number 2:")
print ("The addition is:", a+b)
0
num = int(input ())
Print "num"
0
Make two vars with input and put them together
- 2
a = 2
b = 8
print (a+b)