I have a user input and I want to pass it as the file name parameter of the open function. This is what I have tried:
filename = input("Enter the name of the file of grades: ")
file = open(filename, "r")
When the user input is openMe.py an error arises,
NameError: name 'openMe' is not defined
but when the user inputs "openMe.py" it works fine. I am confused as to why this is the case because I thought the filename variable is a string. Any help would be appreciated, thanks.