Category : readfile

if file is not None: content = file.readlines() if ‘I’ and ‘J’ in content: display_oval() else: display_polygon() in this case,suppose i opened a file containing I&J . i expect to call display_oval() but it calls display_polygon(). when i opened file not containing I&J,display_polygon() calls as expected. when i replaced ‘I’ and ‘J’with ‘I’ or ‘J’,when ..

Read more

this is my code: file1 = open(‘input_file1’, ‘r’) # to read input_file1 file2 = open(‘input_file2’, ‘r’) # to read input_file2 file3 = "output.txt" # the file include output writeOut = open(file3,’w’) lines1=file1.readlines() # read all lines in file 1 lines2=file2.readlines() # read all lines in file 2 for line1 in lines1: # line1 is a ..

Read more