So basically, I'm new to coding and I'm trying to read the contents of a .txt file and I'm able to do that by hardcoding the file path of the .txt file but I'm trying to write lines of code where it accesses it without having to hardcode it.
First I placed the .txt file in the same folder as the python file where I was working on my code on vscode on macOS but I'm given the error "No such file or directory". I then hardcoded the file path instead of the .txt file name and then it worked.