4 ms·
Are you actually suggesting I didn't realize I could've written x = [25, 37, 49], or what? Surely the point of the example wasn't "find the optimal way to calc
by dataflow 4y ago
Are you actually suggesting I didn't realize I could've written x = [25, 37, 49], or what?
Surely the point of the example wasn't "find the optimal way to calculate that particular list of numbers"?
- Jtsummers 4y agoNo, I'm suggesting that your original example was a great example of obfuscated Python. Even supposing that you wanted to alter the total number of values generated and the number of initial values to skip, you're doing unnecessary work and made it more convoluted than necessary: def some_example(to_skip=2, total_count=3): return [n * 12 + 1 for n in range(to_skip, to_skip+total_count)] There you go. Change the variable names that I spent < 1 second coming up with and that does exactly the same thing without the enumeration or discarding values. In a thread on how computer speed is wasted on unnecessary computation, it seems silly that you're arguing in favor of unnecessary work and obfuscated code.