+ 1

Python

What does it mean to split multiple inputs in separate lines ?

11th Feb 2025, 5:18 PM
Botlhale Koikoi
Botlhale Koikoi - avatar
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
11th Feb 2025, 7:52 PM
BroFar
BroFar - avatar
M
11th Feb 2025, 5:25 PM
Lisa
Lisa - avatar
M