How to use partial function to fix a certain number of arguments of a function in Python

1 Answer

0 votes
from functools import *
  
def mul(a, b, c): 
    return a * b * c 
  
mul_p = partial(mul, c = 2, b = 1) 
  
print(mul_p(3)) 




'''
run:

6
 
'''

 



answered Jul 26, 2019 by avibootz
...