Q:

Return positive numbers of a list in python

I'm new to python. I was wondering how i could return and convert the list below into positive numbers. that would 
Print:

[1, 5, 2, 10]

def func(a):
    return abs(a)

print func(a=[1,-5,2,-10])

A:

You want to call the abs function once per element and get the list resulting from doing that. That's exactly what map is for:
return map(abs, a)

You can also use a list comprehension:
return [abs(n) for n in a]

