code: def write_file(filename, contents):
      
      contents = "\n".join(contents)
  
      # assuming the contents has been vetted for utf-8 encoding
      contents = contents.encode("utf-8")
  
      with open(filename, "wb") as f:  # always write POSIX-style manifest
          f.write(contents)
docs: Create a file with the specified name and write 'contents' (a
      sequence of strings without line terminators) to it.