Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
cook your locals() solution in Creative category for 3 Chefs by flpo
from operator import setitem as s
add = lambda a: lambda x, y, z: s(x.__dict__, a, x.__dict__.get(a, 0) + y * z)
class A:
add_food, add_drink = map(add, 'fd')
total = lambda s: f'{s.F}: {s.f}, {s.D}: {s.d}, Total: {s.f + s.d}'
cook = lambda F,D: type('', (A,), locals())
JapaneseCook = cook('Sushi', 'Tea')
RussianCook = cook('Dumplings', 'Compote')
ItalianCook = cook('Pizza', 'Juice')
June 14, 2018