Python Programming - Conditional Statements - Discussion

Discussion Forum : Conditional Statements - General Questions (Q.No. 14)
14.
What is the purpose of the assert statement?
To handle exceptions
To display the current status of the program
To assign None value to an existing object in memory
To check if a condition is true, and if not, raise an AssertionError
Answer: Option
Explanation:
The assert statement is used to test if a given condition is true, and if not, it raises an AssertionError with an optional error message.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.