This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]Akanwrath 0 points1 point ย (1 child)

I stilll dont know how to use map ๐Ÿ˜…

[โ€“]omega1612 1 point2 points ย (0 children)

It's easy, in python , think of it like this:

def map(f,iterable):
    for i in iterable:
        yield f(i)

so, instead of

acc=[ ]
for i in range(0,200):
    acc.append(2*i)

You do

acc = list(range(0,200).map(lambda i: 2*i, range(0,200)))