python programming terminates if you do not close it explicitly file close( reading multi-line records from file sometimes records of file are not one per line records of file may cross multiple lines in that caseyou can' use for loop to read the file you need while loop instead when you use while loopyou need to be able to check condition to see if you are done reading the file butto check the condition you must first try to read at least little of record this is kind of chicken and egg problem which came firstthe chicken or the eggcomputer programmers have name for this problem as it relates to reading from files it is called the loop and half pattern to use while loop to read from filewe need loop and half the half comes before the while loop consider the program we are writing in this let' assume that the records of the file cross multiple lines in factlet' assume that we have variable length records that isthe records of our file consist of one to five lines the drawing commands will be exactly as they were before butinstead of all the data for record appearing on one linewe'll put each piece of data on its own separate line as shown in sect text file with multiple line records beginfill black circle black endfill penup goto black pendown beginfill black circle black endfill penup goto this copy belongs to 'acha