Opens the file data called 'data.txt' and stores the contents in a variable 'myFile'. Reads the first line and stores in a variable called 'line'. Closes the file ...
Files generally have two modes of operation - read from and write to. file = open('scores.txt','w') file.write('Hello') file.close() The code above would open a file ...