>>> def get_function(): ... return exit ... >>> a = get_function() >>> a Use exit() or Ctrl-D (i.e. EOF) to exit