Jan-22-2019, 05:14 PM
Please use python and output tags when posting code and results. I put them in for you this time. Here are instructions for doing it yourself next time.
I'm not sure what you need enumerate for, you don't seem to be using idx. However, a list comprehension will handle the multiplication problem:
I'm not sure what you need enumerate for, you don't seem to be using idx. However, a list comprehension will handle the multiplication problem:
newList = [] for rec in tmp: newList.append([item * 2 for item in rec])It's a quick way to write a loop that creates a list. In fact, your whole code could be one big list comprehension:
newList = [[item * 2 for item in rec] for rec in tmp]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures