Vidyalelo
Python · Q26

Files Handling in Python

Programming · Python · question 26

Q26

How can you check if a file exists in Python before opening it?

A.
By using the os.path.exists() function
Answer
B.
By using the file.exists() method
C.
By using the file.is_existing() method
D.
By using the file.exist() method

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board