Random internet people explaining math better then math teacher
Random internet people explaining math better then math teacher
You're viewing a single thread.
All comments
204
comments
You can reduce this readable code into one line of confusing python list comprehension that runs 100x slower!
18 0 ReplyWhat's wrong with list comprehensions? Do I just have Stockholm Syndrome at this point?
I would skip the square brackets and just use a generator expression:
sum(3*n for n in range(5))
.8 0 ReplyYes, the classic readability of c style for loops.
How about some Haskell
let numbers = [1, 2, 3, 4, 5] let sumOfNumbers = sum numbers
6 0 ReplyI don't think you can use python list comprehensions in this case, since you don't want a new list, but rather reduce it to a single value.
3 0 Reply
204
comments
Scroll to top