0
How to write a program to take two integers as input and output their sum.
2 and 8 sample input 10 sample output
4 Answers
+ 3
x=int(input())
y=int(input())
print(x+y)
...easy
+ 2
Hi Rhys Law
I noted that you are working your way through Python Core, so you may wish to review the following concepts.
Create a variable which will receive user input, but be recognised as an integer.
num1 = int(input())
Do the same for the second input, let's call it num2
From here, we can directly print a result -> print(num1 + num2)
Or, we can create another variable
result = num1 + num2
Which we can print
print (result)
See if you can create your own code from these examples
+ 1
Thanks for your help