Result of this piece of code:
cols = list(zip(['B', 'D', 'F', 'H'], ['C', 'E', 'G', 'I']))is same as this:
cols = [('B', 'C'), ('D', 'E'), ('F', 'G'), ('H', 'I')]As second way requires less typing (and less conversion too) it may be better. However, zip is very handy if there are already existing lists. For example, if you have already lists for columns (say
first
and second
) created in your code earlier then you can do:cols = list(zip(first, second))
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.