There are a couple ways:
The most straightforward one, collect all eligible functions in a dictionary:
functions = {f.__name__: f for f in [test1, test2, test3, test4, test5, test6]} functions[input(">")]()
Or, a sneaky way, using globals(), just be careful that you'll be effectively allowing the user to call any functions in the global scope, not just the ones that you think they should have:
globals()[input(">")]()
Or a super sneaky way of using eval() or if you're doing this in a loop, just starting a shell to allow full arbitrary code execution using code.interact(), which will also allows the user to specify the function parameters, and reformat your harddisk if the user account running the code has privilege to do so:
import code code.interact()
{"test1": test1, "test2": test2}["test2"]()