+ 2
Is it possible that the code playground doesn't work properly?
On a multiple inputs it returns just one arg in the list https://code.sololearn.com/cfBvbodJq5V6/?ref=app
23 Answers
+ 3
You don't have multiple inputs in your code....
Your input() returns a string which you then split() (by spaces) and returns a list.
Just input "1 2 3 4" (without the quotes)....outputs as expected.
+ 2
Sometimes happens.
+ 1
Giving input like 1234 and calling the split() on it will return a list ['1234'] because the split by default uses a space separator.
In order to get a list you must either give inputs like rodwynnejones mentioned or you can do-
x = input()
print(list(x))
+ 1
Sorry, i use the translator of google to translate pags and the ask is... somewhat different
+ 1
In one word your answer is "Yes" few days ago I also faced this problem
+ 1
Mario Leofreddi also i would like to say that, input at this platform little bit different,you should enter one time aaaaaall inputs whitch will be used in program
0
"input()" only take one input, if you want to take more inputs write more "input()" or use a loop (for, while)
0
Sorry, but .split() wasn't to pass several args to a list? If I repeat the same code on other codeplayground, they give me a list as I expect
0
What's your input like?
0
I×Am×Idiot for instance, I just tried on pydroid 3 and I got x = [1, 2, 3, 4]
0
Avinesh x = input().split()
Print(x) on several inputs I receive in list x only one value
0
If you try the code in pydroid and the output is [1,2,3,4], pydroid have bugs lol
0
U can use this:
x=[]
while True:
x.append(input())
print(x)
0
rodwynnejones I agree and I write what you say but in code playground I receive just one value in the list (e.g. 1 2 3 4 => [1])
0
What I do. I agree with you all but I get in return just one value. Nevermind. I'll do as I×Am×Idiot suggest.
Thank you
0
The code of Avenish only works in one input, example:
x=input() //in this example the input is 1234
print(list(x))
The output is: ["1","2","3","4"]
But if you try to write more inputs or numbers of more digits is useless
0
@I×Am×Idiot
.....and that is why Avinesh asked.... "What's your input like?"
0
For some reason, the question is "What is your opinion?" lol
0
I×Am×Idiot no problem. Thanks For me there is a bug in code playground also considering that in challenges it works properly
0
Challenges? You mean code coach?