with open("bruh.txt") as file:
print(file.read())
print(file.closed)
Output:
PS C:\\Users\\hp\\Desktop\\sss\> & C:/Users/hp/AppData/Local/Mi crosoft/WindowsApps/python3.11.exe c:/Users/hp/Desktop/sss/file.py
True
PS C:\\Users\\hp\\Desktop\\sss\>
The file is in the same folder so I don't need to list the path, I saw a video on Youtube, he wrote the same code and the content of his file was printed in the terminal
The name of the file was verified; then the path was listed. I googled the problem, but the results did not help. They assumed the file did not exist, but it did