0
How to read a list
g=input is list
2 Antworten
+ 1
if input is like "123" : li = list(input())
else if input is like "1 2 3" : li = input().split(' ')
0
Depends on how you want your input to be and what type etc, but here are a few ideas.
To make the input '1234' into a list ['1', '2', '3', '4']
simply do:
g = list(input())
to make the input '1 2 3 4' into a list [1, 2, 3, 4]
g = [int(x) for x in input().split()]
or
g= list(map(int, input().split()))