code: def set_unbuffered_mode():
      
      class Unbuffered(object):
          def __init__(self, stream):
              self.stream = stream
          def write(self, data):
              self.stream.write(data)
              self.stream.flush()
          def __getattr__(self, attr):
              return getattr(self.stream, attr)
  
      sys.stdout = Unbuffered(sys.stdout)
docs: make output unbuffered