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 248 views
1 answer 154 views
1 answer 148 views
1 answer 163 views
1 answer 171 views
171 views asked Jan 5, 2021 by avibootz
1 answer 178 views
...