Friday , September 20 2024

The following statement: assert var == 0

Questions BankCategory: Python Essentials 2The following statement: assert var == 0
The following statement:

assert var == 0
  • has no effect
  • will stop the program when var != 0
  • will stop the program when var == 0
  • is erroneous

Explanation: Remember that the assert keyword tests if a condition is true. If it is not, the program will raise an AssertionError.

More Questions: Python Essentials 2 – Module 2 Test
More Questions: Python Essentials 2 (PE2) Course Final Test