1. 4
  1.  

  2. 1

    print() prints all its non-named arguments to its file= named argument, defaulting to sys.stdout.

    There is also contextlib.redirect_stdout.