2 ms·
weekly = [sum(daily[j:j+7]) for j in range(0, len(daily), 7)] While I appreciate the general sentiment that high-level languages will take over the world, ther
by _pius 17y ago
weekly = [sum(daily[j:j+7]) for j in range(0, len(daily), 7)]
While I appreciate the general sentiment that high-level languages will take over the world, there is very little that's new in this article and I am not impressed by the showpiece Python code from the article. For loops are the future?
- fcr 17y agoWell I guess the list comprehension and list slicing features in the above example are more interesting than the for loop.