Why does it say there is no such file?
Some users have had issues with the file they’re trying to open not existing, according to the terminal anyways. The solution seems to be making any slight change to the file,
text.txt, and then going back to your Python file and running it again.
This is very unlikely to be the case, though. Be sure that you’ve properly opened the file by writing
my_file = open("text.txt", "r").
Then you can
my_file.readline() three times to see the three lines of the text file!