Next Index Previous

Python Examples

23. map() function example.

nums = [5,7,3]
def square(n):
	return (n*n)

res = list(map(square, nums))
print(res)

Output :
[25,49,9]



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands