Why output do not shows in order of precedence
file = open("newfile.txt", "w") file.write("Some new text") print(file.write(" PYTHON88")) file.close() file = open("newfile.txt", "r") print("Reading new contents") print(file.read()) print("Finished") file.close() Ouput is: 8; Reading new contents;Some new text PYTHON88; Finished. Questions: I) . Why do the output 8 occur here. Is it the length of the string PYTHON88. I) In Order of CODE, the Output "Some new text PYTHON88" should hAve occur before "Reading new contents". But how come not. II) Did it print(file.read()). If not why is it there. Why it don't gives Argument error like in print(file.write()) III) Why do Output gives Argument Error when I write use print(file.write()) . IV.) What happens if file.close() is not used. Do it make any changes. V) Did the code overwrite, which line of code shows overwrite.