Advertisements
Advertisements
प्रश्न
Write a try .... except statement that attempts to open a file for reading and catches the exception thrown when the file does not exist.
कोड लेखन
Advertisements
उत्तर
try:
file = open("data.txt", "r")
except FileNotFoundError:
print("File does not exist.")shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
