Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyhton map

def calculateSquare(n):
    return n*n


numbers = (1, 2, 3, 4)
result = map(calculateSquare, numbers)
print(result)

# converting map object to set
numbersSquare = list(result)
print(numbersSquare)
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #pyhton #map
ADD COMMENT
Topic
Name
1+9 =