93.0k views
3 votes
The statement print(words[len(words)]) will raise an exception. What should be placed in the blank so that this exception will be caught and the error message will be displayed?

A,B,C,D?

The statement print(words[len(words)]) will raise an exception. What should be placed-example-1

1 Answer

3 votes

The answer D.

Put the except IndexError to catch IndexError which gets raised when the statement gets executed.

User Monstr
by
8.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.