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 198 views
1 answer 111 views
1 answer 99 views
1 answer 90 views
1 answer 134 views
134 views asked Jan 5, 2021 by avibootz
1 answer 143 views
...