+ 1
Python
What does it mean to split multiple inputs in separate lines ?
2 Antworten
+ 7
Botlhale Koikoi depending on what exactly you are referring to but sololearn Popup is generally something like:
Popup:
12
13
14
submit
a = int(input()) # 12 assigned to a
b = int(input()) # 13 assigned to b
c = int(input()) # 14 assigned to c
print(a)
print(b)
print(c)
Console: Output
12
13
14
Or you can go with something like this:
Popup:
12 13 14 submit
a, b, c = map(int, input().split(" ")) # again each one is assigned to a variable
a = 12, b = 13, c = 14
print(a)
print(b)
print(c)
Console: Output:
12
13
14
If you have one input or say 5 to 10 inputs all must be done in the initial Popup on sololearn
This will work as Popup only opens once ..
Popup:
12
13
14
submit
for i in range(3):
n = int(input())
print(n)
Console: Output:
12
13
14
https://sololearn.com/compiler-playground/WX0XY4m105iz/?ref=app
+ 5
https://www.sololearn.com/discuss/3316927/?ref=app
https://www.sololearn.com/discuss/3315069/?ref=app
https://www.sololearn.com/discuss/3314157/?ref=app