code: def print_inplace(*args, **kwargs):
      
      kwargs.setdefault('file', sys.stdout)
      kwargs.setdefault('end', '')
      pos_save(file=kwargs['file'])
      delay = None
      with suppress(KeyError):
          delay = kwargs.pop('delay')
      if delay is None:
          print(*args, **kwargs)
      else:
          for c in kwargs.get('sep', ' ').join(str(a) for a in args):
              kwargs['file'].write(c)
              kwargs['file'].flush()
              sleep(delay)
          if kwargs['end']:
              kwargs['file'].write(kwargs['end'])
      pos_restore(file=kwargs['file'])
      # Must flush to see changes.
      kwargs['file'].flush()
docs: Save cursor position, write some text, and then restore the position.
          Arguments:
              Same as `print()`.
  
          Keyword Arguments:
              Same as `print()`, except `end` defaults to '' (empty str),
              and these:
                  delay : Time in seconds between character writes.