0
Why doesn't this output a sum input1=2 input2=8 print(input1+input2)
6 Réponses
+ 1
print(int(input())+int(input()))
Are you trying to add two integers??
(You can use the above code)
//
For to add them as strings you can do:
print(input()+input())
+ 1
That code runs as i tested it. The code doesn't read user input, so no type conversion was necessary. You just created two integer variable and print the sum of the two, no problem at all.
0
Really? show your code?
0
input1=2
input2=8
print(input1+input2)
0
Thanks
0
nb1 = int(input())
nb2 = int(input())
print(nb1+nb2)