+ 2

x =int(input()) y =int(input()) print(x+y)

Why can't python take two inputs

17th Jun 2022, 8:38 PM
Victor [The Coder]
Victor [The Coder] - avatar
11 Answers
+ 6
Yes, python can. On Sololearn Playground works it only in this way: 2 3
17th Jun 2022, 8:42 PM
JaScript
JaScript - avatar
+ 5
Chiemerie Ekwueme E. , your answer is confusing me. what do you mean by: "one of them has to be a float" ???
18th Jun 2022, 11:10 AM
Lothar
Lothar - avatar
+ 3
You need to input both number at once, separated by a line break. Read what the text in the pop-up says.
17th Jun 2022, 8:43 PM
Lisa
Lisa - avatar
+ 3
It does NOT mean "using eval() function", floats are not required to solve the task. float() and eval() are misleading if someone tries to solve the task or tries to get multiple inputs.
18th Jun 2022, 1:22 PM
Lisa
Lisa - avatar
+ 2
Okay
18th Jun 2022, 1:23 PM
Victor [The Coder]
Victor [The Coder] - avatar
+ 2
and so: a, b=int(input()),int(input()) def sum(a, b): return a + b print(sum(a, b)) If use in the function
11th Jul 2022, 8:04 PM
Tolkuev
+ 2
Hii sir msg me
20th Jul 2022, 1:28 PM
Aryan Maurya Mr.perfect
Aryan Maurya Mr.perfect - avatar
+ 1
Thanks
17th Jun 2022, 8:49 PM
Victor [The Coder]
Victor [The Coder] - avatar
+ 1
It means using EVAL() function
18th Jun 2022, 11:43 AM
Victor [The Coder]
Victor [The Coder] - avatar
+ 1
Yes
19th Jun 2022, 4:28 PM
Abel D PadrĂłn Vega
Abel D PadrĂłn Vega - avatar
- 1
One of them has to be a float
18th Jun 2022, 8:09 AM
EmmzyCodez
EmmzyCodez - avatar