0
How do I add 2 different user inputs?
I am trying to add 2 inputs but it won’t work. :(
4 ответов
+ 5
This?
print(int(input()) + int(input()))
assuming the numbers are integers, otherwise use float(input())
See this: https://code.sololearn.com/WhiNb9BkJUVC
0
https://www.sololearn.com/discuss/1687958/?ref=app
https://www.sololearn.com/discuss/2520313/?ref=app
https://www.sololearn.com/discuss/1782227/?ref=app
https://www.sololearn.com/discuss/2344459/?ref=app
https://www.sololearn.com/discuss/2324185/?ref=app
https://www.sololearn.com/discuss/2434014/?ref=app
https://www.sololearn.com/discuss/1403817/?ref=app
https://www.sololearn.com/discuss/1102599/?ref=app
https://www.sololearn.com/discuss/1735215/?ref=app
https://www.sololearn.com/discuss/1422651/?ref=app
0
is this what you were looking for?
input1 = input()
input2 = input()
0
i must have missed the adding portion. as a note, im pretty sure inputs are declared as string and there for must be converted to integer or float to perform any math function to them. David Ashton provided a good example of converting inputs to integers.