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 241 views
1 answer 146 views
1 answer 138 views
1 answer 157 views
1 answer 164 views
164 views asked Jan 5, 2021 by avibootz
1 answer 172 views
...