How to use map() to call a function multiple times with different arguments values with Python

1 Answer

0 votes
def mul(n): 
    return n * n 
  
arguments = (1, 2, 3, 4, 5) 

result = map(mul, arguments) 

print(list(result)) 
 
 
 
'''
run:
 
[1, 4, 9, 16, 25]
 
'''

 



answered Dec 14, 2019 by avibootz

Related questions

3 answers 255 views
1 answer 156 views
1 answer 150 views
1 answer 166 views
1 answer 173 views
173 views asked Jan 5, 2021 by avibootz
1 answer 183 views
...