I would like to open a text file named file1.txt, count the length, then close it with the name file2.txt.
I very much prefer not importing anything.
file1 = open('file1.txt')
def wordCount(file1):
contents = file1.read()
file1.close()
print(contents)
return len(contents)
print(wordCount(file1))
It comes out as it should but I have no idea where begin the next step of the process.