Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dan's Q of Assertion?  RSS feed

 
Vishy Karl
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is the Q from Dan's Exam

Ans given are a,b,d.
Why is b also correct ?? If assertions r disabled then how will it show AssertionError message ?
TIA.
bye
 
Rama Kumar PV
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is just like any other error/exception and is not related to enabling or disabling of assertions. Enabling/Disabling of assertions will affect only those lines having the assert keyword followed by a boolean expression.
Rama
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!