fork download
  1. def execute(code):
  2.  
  3. actions = {
  4. 1: lambda: 'first',
  5. 2: lambda: 'second',
  6. 3: lambda: 'third'
  7. }
  8.  
  9. return (actions.get(code, False) or (lambda: 'not implemented'))()
  10.  
  11. for i in range(10):
  12. print(i, execute(i))
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
0 not implemented
1 first
2 second
3 third
4 not implemented
5 not implemented
6 not implemented
7 not implemented
8 not implemented
9 not implemented