[Solved] Print lists in list


Not sure what you mean with “store the data of ‘li1’ into an index”. I’m assuming you want a list of lists? You could append the list.

k = "/BTC"
result_list = []
for i in range(l):
    if k in dat1["Data"][i]['Label']:
        value = dat1["Data"][i]['Label']
        value1 = dat1["Data"][i]['TradePairId']
        value2 = dat1["Data"][i]['AskPrice']
        value3 = dat1["Data"][i]['BidPrice']
        result_list.append([value, value1, value2, value3])
print(result_list)

3

solved Print lists in list