LearnPy Hub
← File Handling problems
Easy

Does the File Exist?

Read a file name. Print os.path.exists(name), then create the file with some text and print it again.

Input

One file name.

Output

Two lines.

Sample 1

Input
data.txt
Output
False
True

Sample 2

Input
x.csv
Output
False
True
solution.py
Output appears here
Does the File Exist? · Python practice problem · LearnPy Hub