Oct-01-2016, 06:30 PM
It's my understanding that list comprehensions are more efficient than full for loops. Since they are more limited, they don't require as much processor overhead as a full for loop. I have not tested this to confirm it.
I expect most people who think list comprehensions are easier to read really just believe they're easier to type.
If you're not doing anything big enough to worry about efficiency, it's personal preference. I'm sure there are people who would look down their noses at you using a full for loop, but I don't think such noses are worth looking down.
I expect most people who think list comprehensions are easier to read really just believe they're easier to type.
If you're not doing anything big enough to worry about efficiency, it's personal preference. I'm sure there are people who would look down their noses at you using a full for loop, but I don't think such noses are worth looking down.
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