- 1
Write a program to take two integers as input and output their sum. Sample Input: 2 8 Sample Output: 10
I cannot write a program as given in question.
11 Respostas
+ 1
Use
"+" to add 2 numbers
input() to take input
int() to convert string input to int.
+ 1
Siddhartha Kushwaha you need to try at least something .
If we provide you full codes you won't be able to learn that topic.
+ 1
En la leccion de python core se explica el funcionamiento dela funciĂłn input(), de la misma manera explican varios ejemplos relacionados a tu pregunta:
https://code.sololearn.com/cDT0hK31LAC1/?ref=app
https://code.sololearn.com/c4L15Ps6nd4l/?ref=app
https://code.sololearn.com/c6idvGjOgVoC/?ref=app
https://code.sololearn.com/cJcv9Gqt2v8k/?ref=app
0
Can you write full code please??đđ»đđ»
0
Please post your attempt
0
product= int(input(2))+ int(input(8))
print(product)
# I wrote this.
0
A very short format
print(int(input())+int(input()))
0
I tried so many timesđđ
0
Why your code doesn't work is because of the numbers in the input function
0
Can you write full code??đđ»đđ»
0
# your corrected code:
product= int(input())+ int(input())
print(product)
# your code was only failing because input take an argument used to be printed before asking input to user, and test doesn't expect you print anything else than the result ;)