fork download
  1. x = 1
  2. if x == 0:
  3. print("imprime 0")
  4. elif x == 1:
  5. print("imprime 1")
  6. elif x == 2:
  7. print("imprime 2")
  8. else:
  9. print("imprime outra coisa")
  10.  
  11. print({
  12. 1 : "deu um",
  13. 2 : "deu dois",
  14. }[x])
  15.  
  16. print({
  17. 1 : lambda x: x + 2,
  18. 2 : lambda x: x - 2,
  19. 3 : lambda x: x * 2
  20. }[x](5))
  21.  
  22. #https://pt.stackoverflow.com/q/211841/101
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
imprime 1
deu um
7