maybe this question is asked before but I have a list of dictionaries that I need to split it into smaller chunks with returning the only specific values of that dictionaries.
my_list = [
{"name": "q", "id":1},
{"name": "w", "id":2},
{"name": "z", "id":3},
{"name": "f", "id":44},
{"name": "k", "id":55},
{"name": "d", "id":8},
{"name": "t", "id":25},
]
n = 4
x = [my_list[i:i + n] for i in range(0, len(my_list), n)]
print(x)
this code works perfectly fine but I need to return only ids:
[[1, 2, 33, 44], [55, 8, 25]]