What happens when the following statement is executed and file1.txt is not present in the current directory?
file_obj = open("file1.txt", "r")
1
Python creates a new file ‘file1.txt’
2
Raises a FileNotFoundError
3
Raises an IOError
4
Does nothing
What happens when the following statement is executed and file1.txt is not present in the current directory?
file_obj = open("file1.txt", "r")
Python creates a new file ‘file1.txt’