मराठी

When are the following built-in exceptions raised? Give examples to support your answer. IOError - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

When are the following built-in exceptions raised? Give examples to support your answer.

IOError

टीपा लिहा

उत्तर

It is raised when the file specified in a program statement cannot be opened.

 >>> f = open("abc.txt",'r')
       Traceback (most recent call last):
         File "", line 1, in 
           f = open("abc.txt",'r')
       FileNotFoundError: [Errno 2] No such file or directory: 'abc.txt'
shaalaa.com
Built-in Exceptions
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1: Exception Handling in Python - Exercise [पृष्ठ १७]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 12
पाठ 1 Exception Handling in Python
Exercise | Q 2. b) | पृष्ठ १७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×