0
Write a program to take two integers as input and output their sum. Sample Input: 2, 8 Sample Output: 10
Please help me out with this
9 Respuestas
+ 4
Hey, your code is good, the only problem is that x and y are treated like strings here cos input() returns the text that the user entered. So remember, if you wanna treat them like ints (the data type used for entire numbers) you can use int() function and give input() as an argument. This will return the integrer version of the input.
This should be the code:
# your code goes here
x = int(input())
y = int(input())
print (x+y)
Hope this can help you!!
:)
+ 2
Bro I have noticed, you are still learning python. Not bad but don't just rush though it, take your time and understand.
Your problem is very simple but try coding it yourself in the code playground and see, if you have a problem then you can link your code here for help
+ 1
Learn to use google or even learn some basic maths and programming ,
+ 1
Yep it sure does ur d best
0
NDUBUISI PRINCE CHIMEREMEZE, show your attempt plz.
0
Kk
0
See my attempt here
0
input(int())
- 1
# your code goes here
x = input()
y = input()
print (x+y)