# create two new files
a = open("file.txt","w+")
b = open("file2.txt", "w+")
#write to file
a.write("text in english")
b.write("text in english2")
#read the file & print the text to console
teksts1 = a.read()
teksts2 = b.read()
print(teksts1)
print(teksts2)
#close both files, so we don't run into problems
a.close
b.close
I'm probably blind for not seeing the problem here, but for some reason it doesn't output anything. Its like the file is empty or something, however they are not.
w+means read and write..read()method reads from the current location in the file, but you're at the end, so there's nothing to read.