(filename, contents)
Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
Create a file with the specified name and write contents ( a sequence of strings without line terminators ) to it .
def write_file (filename, contents):
    """Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    """
    f = open(filename, "w")
    try:
        for line in contents:
            f.write(line + "\n")
    finally:
        f.close()
def write_file ( filename , contents ) : f = open ( filename , "w" ) try : for line in contents : f . write ( line + "\n" ) finally : f . close ( )