def a(): print('HUI') def b(): print('Pyzda') handlers = {'hui':a, 'pizda':b} g=lambda f: (callable(handlers.get(f)) and (handlers.get(f))) or (lambda: (_ for _ in ()).throw(NameError('Function %s is not defined'%f)))() g('hui')()g('pizda')()g('govno')()
Standard input is empty
HUI Pyzda
Traceback (most recent call last): File "./prog.py", line 13, in <module> File "./prog.py", line 9, in <lambda> File "./prog.py", line 9, in <lambda> File "./prog.py", line 9, in <genexpr> NameError: Function govno is not defined
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!