the syntax for opening a file is to use the open() and to open a file you could do x = open(filename, 'r') code example
Example 1: freecodecamp python write to file
f = open("data/names.txt", "r+") # Read + Write
Example 2: freecodecamp python write to file
f = open("data/names.txt", "w+") # Read + Write