+ 1
How to create multiple inputs?
Is there any way to create multiple inputs here in Sololearn, in Python?
6 Answers
+ 1
Yes, you can, you just need to split them into separate lines in the dialog box.
+ 3
Ryan Gosling there's already exactly the same answer from Just A Rather Ridiculously Long Username
+ 2
Artem Khaiet Of course your code can't read two lines, because there's only one input()!
If you need two inputs, print so:
a = input()
print(a)
b=input()
print(b)
You can use this code for infinity inputs:
while True:
print(input())
However, it raises EOF Error at the end. So, you can catch this exception:
while True:
try:
print(input())
except EOFError:
break
Unfortunately, it's impossible here to get inputs when code runs. Anyway, it's enough for testing.
+ 1
No.
I made this but I donât think thatâs what you are looking for.
https://code.sololearn.com/WBSLsJW430mB/?ref=app
+ 1
ââMeowg!iâ¶â¶ Thanks!
Although it's not really what I was expecting multiple inputs to be, I guess I can do something with it.
0
Just splite them into separate lines while inputting