Computer Science
If no path is given with a file name in the file open(), then the file must exist in the current directory.
Python File Handling
2 Likes
Answer
True
Reason — If no path is given with a file name in the open() function in Python, then the file is assumed to be located in the current working directory. If the file is not found in the current working directory, Python will raise a 'FileNotFoundError' exception.
Answered By
1 Like
Related Questions
The relative path for a file always remains the same even after changing the directory.
The types of operations that can be carried out on a file depend upon the file mode a file is opened in.
Functions readline() and readlines() are essentially the same.
Python automatically flushes the file buffers before closing a file with close() function.