Answers for "what does the map function do in python"

1

map in python

items = [1, 2, 3, 4, 5]
squared = []
for i in items:
    squared.append(i**2)
Posted by: Guest on August-19-2021
0

função map python

lista =  [1, 2, -3, 4, 5, -9]
def quadrado(n):
    return n*n
 
map(quadrado, lista)
[1, 4, 9, 16, 25, 81]
Posted by: Guest on May-03-2020

Code answers related to "what does the map function do in python"

Python Answers by Framework

Browse Popular Code Answers by Language