English

Write the syntax of the raise statement.

Advertisements
Advertisements

Question

Write the syntax of the raise statement.

Code Writing
Advertisements

Solution

Syntax of raise statement:

raise ExceptionName("Error message")

Example:

raise ValueError("Invalid value")
shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Exception Handling & Generate Functions - EXERCISE [Page 158]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 8 Exception Handling & Generate Functions
EXERCISE | Q 10. | Page 158
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×