3 ms·
Not sure what you mean in the 2nd to the last paragraph. I really prefer using the map function: sum(map(lambda s: len(s) if s.startswith('a') else 0,['abac'
by lightlyused 6y ago
Not sure what you mean in the 2nd to the last paragraph. I really prefer using the map function:
sum(map(lambda s: len(s) if s.startswith('a') else 0,['abac','bced','asdasdf','lkjkl','assadf']))
The crazy sql like syntax of your C# example bugs me a lot.
- zanellato19 6y agoThe C# example is much, much easier to read for me than yours. The else specially
- higerordermap 6y ago> sum(map(lambda s: len(s) if s.startswith('a') else 0,['abac','bced','asdasdf','lkjkl','assadf'])) I'd rather have comprehensions than map and filter that can't fit in pipeline.