Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
__call__ lambda solution in Scary category for Multiply (Intro) by Wartem
class Operation:
def __init__(self, f):
self.f = f
def __call__(self, a, b):
return self.f(a,b)
def mult_two(a: int, b: int) -> int:
return Operation((lambda a_, b_: a_ * b_))(a,b)
Aug. 6, 2022
Comments: