+ 8
Asserts are like if?
you compare data and if is right continue and if not(else) raise an exception?
7 Réponses
+ 19
Kind of. Using assert supports debugging and yes, it works as if you check on a condition being True. If it is False, AssertionError() is raised.
+ 11
Seems like that. Only that there ain’t an “else” statement to execute. Either you go through and execute the next command or you land into an error.
+ 1
Thanks a lot
+ 1
Good question!
0
I also had the same doubt!thanks.
0
Use accerts in testing the code ... I have not seen accerts in production code .... some one can correct me if my assumption is wrong
0
What I have seen is that asserts stop completely if anything turns out to be false.