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 256 views
1 answer 157 views
1 answer 151 views
1 answer 167 views
1 answer 174 views
174 views asked Jan 5, 2021 by avibootz
1 answer 183 views
...