Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def a(arg):
  2. print('a %s' % arg)
  3.  
  4. def b(arg):
  5. print('b %s' % arg)
  6.  
  7. def c(arg):
  8. print('c %s' % arg)
  9.  
  10. def test_function(func_to_call):
  11. a_dict = {
  12. 'a': 2,
  13. 'b': 3,
  14. 'c': 4,
  15. }
  16.  
  17. exec('%s(%s)' % (func_to_call, a_dict.get(func_to_call)))
  18.  
  19. test_function('a')
  20. test_function('b')
  21. test_function('c')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement