Answer the question
In order to leave comments, you need to log in
How to complete the list?
Let's say I have a list:
How can I put new data to come out:
And how can I make it so that if in 2: abc, def, 123.
Then in 1 add: xyz, "", ""
data = {"1": ["xyz", ""]}
{"1": ["xyz", ""], "2": ["abc", "def"]}
Answer the question
In order to leave comments, you need to log in
so list or dictionary?
your example is like this:
data["2"] = ["abc", "def"]
The second question was solved with this solution:
long = 0
for val in data.values():
if long < len(val):
long = len(val)
for val in data.values():
add_long = long - len(val)
for row in range(add_long):
val.append('')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question