May-14-2018, 12:32 AM
That's a weird error to be getting, but you can solve it by not re-using variable names (you reuse z here). Take your list comprehension and write a nested loop instead. Only after you've gotten that working should you try putting it back into the more advanced form.