def f(x): { 'a': print(1), 'b': print(2), }[x] print(f('a'))print(f('b'))
Standard input is empty
1 2 None 1 2 None
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!