The map call is similar to the list comprehension expressions:
def inc(x): return x + 10 # Function to be run # w w w. j av a 2 s .c o m d=list(map(inc, [1, 2, 3, 4])) print( d ) d=[inc(x) for x in [1, 2, 3, 4]] # Use () parens to generate items instead print( d )