Jan-22-2019, 05:15 PM
You can take advantage of list comprehension:
>>> lst = [1, 2, 3] >>> [x * 2 for x in lst] [2, 4, 6]It 'reads' something like that: give me element multiplied with 2 for for every element in lst
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.