This language bar is your friend. Select your favorite languages!

Idiom #37 Currying

Transform a function that takes multiple arguments into a function for which some of the arguments are preset.

from functools import partial
def f(a):
	def add(b):
		return a+b
	return add

print (f(2)(1)

#add_to_two = partial(f, 2)