SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Y Daniel Lang
Chapter:
To Computers Programs And Python
Exercise:
Check Point
Question:34 | ISBN:978013274719 | Edition: 6

Question

If your program needs to read data from a file, but the file does not exist, an error would occur when running this program. What kind of error is this?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

IOError

For example, trying to open a nonexistent file triggers a type of exception called an IOError … … while an out-of-bounds index to a list triggers an IndexError. By default, when an exception occurs, Python prints it out and stops our program.

0 0

Discussions

Post the discussion to improve the above solution.