Write a Python program to check whether a file exists
I have used python 3.7 compiler for debugging purpose.
import os.path open('tech.txt', 'w') print(os.path.isfile('tech.txt'))
Result:
True
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used python 3.7 compiler for debugging purpose.
Result:
True
need an explanation for this answer? contact us directly to get an explanation for this answer