HOME/Articles/

python code map functions (snippet)

Article Outline

Python example 'python code map functions'

Functions in program:

  • def multiply(n):

python code map functions

Python code example: python code map functions


#Use map functions
def multiply(n): 
    return n * n 

list = (1, 3, 5) 
result = map(multiply, list) 
print(list(result))

More Python: https://pythonprogramminglanguage.com