0

How do I add 2 different user inputs?

I am trying to add 2 inputs but it won’t work. :(

27th Mar 2021, 10:54 PM
James Hall
James Hall - avatar
4 ответов
+ 5
This? print(int(input()) + int(input())) assuming the numbers are integers, otherwise use float(input()) See this: https://code.sololearn.com/WhiNb9BkJUVC
28th Mar 2021, 3:15 AM
David Ashton
David Ashton - avatar
0
is this what you were looking for? input1 = input() input2 = input()
28th Mar 2021, 2:09 AM
you are smart. you are brave.
you are smart. you are brave. - avatar
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.
28th Mar 2021, 9:15 PM
you are smart. you are brave.
you are smart. you are brave. - avatar