Oct-24-2020, 09:33 PM
I'm not sure what you're asking. It looks like asking for an element of your generator (can you post the generator code?) already gives you exactly what you want. If you put it in a list, it adds another layer of list (a second set of brackets).
So don't put it in the list and you should be good.
Can you give more information why
So don't put it in the list and you should be good.
Can you give more information why
print(next(gen)) # gives ==> [4, 2]
isn't sufficient?