fork(2) download
  1. from random import randint
  2.  
  3. def Fun_1():
  4. print("Executada a Fun_1")
  5.  
  6. def Fun_2():
  7. print("Executada a Fun_2")
  8.  
  9. def Fun_3():
  10. print("Executada a Fun_3")
  11.  
  12. def Fun_4():
  13. print("Executada a Fun_4")
  14.  
  15. functions = locals()
  16. x = randint(1, 4)
  17. nome_fun = "Fun_" + str(x)
  18.  
  19. print("x =", x)
  20. functions[nome_fun]()
Success #stdin #stdout 0.02s 37616KB
stdin
Standard input is empty
stdout
x = 1
Executada a Fun_1