4 ms·
Did you use python specific functions like list comprehensions, or "classic" for/while loops? Because I've found the former to be surprisingly fast, while naive
by remuskaos 4y ago
Did you use python specific functions like list comprehensions, or "classic" for/while loops? Because I've found the former to be surprisingly fast, while naive for loops are incredibly slow in python.
- bbojan 4y agoI've used list comprehensions where they make sense. But it's a non-trivial (although a simple) program, so there are for loops too. So I'm using a mix of chain and permutations from itertools, list comprehensions and for loops.
- momojo 4y agoAren't most of the python primitives implemented in C?