3 ms·
For me list comprehensions are a godsend. I believe the loop logic is much better expressed in a single line of code than multiple lines of for or while syntax.
by sharmi 9y ago
For me list comprehensions are a godsend. I believe the loop logic is much better expressed in a single line of code than multiple lines of for or while syntax. No intermediate variables too. Now, this is becoming a common feature in all young languages, but the first time I encountered it in python a decade ago, I was on cloud 9. It is still one of my filter criteria when deciding if a language is worth investing in.