with open ("data.txt", "r") as myfile: data = myfile.read().splitlines()
Here is what the above code is Doing:
1. Opening the file in read mode.
2. Reading the contents of the file into a variable called data.
3. Splitting the contents of the file into a list.