Follow

@0@mamot.fr I'd suggest writing the code like this:

```
>>> a = [1, 2, 3]
>>> list(map(lambda i: i+10, a))
[11, 12, 13]
>>> # or
>>> [i+10 for i in a]
[11, 12, 13]
>>>
```

· · Web · 1 · 0 · 0

@masipcat @0 the second one is more pythonic - list comphrehensions rule!

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!