venture of iit bombay vjti alumni print "closed or not "fo closed print "opening mode "fo mode print "softspace flag "fo softspace this produces the following result name of the filefoo txt closed or not false opening mode wb softspace flag the close(method the close(method of file object flushes any unwritten information and closes the file objectafter which no more writing can be done python automatically closes file when the reference object of file is reassigned to another file it is good practice to use the close(method to close file syntax fileobject close()