LearnPy Hub
← File Handling problems
Easy

Missing File

Read a file name and try to open it for reading. Print its first line, or File not found. (Only exists.txt exists; create it first with the text I exist.)

Input

One file name.

Output

One line.

Sample 1

Input
exists.txt
Output
I exist

Sample 2

Input
nope-4821.txt
Output
File not found
solution.py
Output appears here
Missing File · Python practice problem · LearnPy Hub