so the assertion will terminate the program and the try-exxcept won't? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

so the assertion will terminate the program and the try-exxcept won't?

8th Aug 2019, 3:35 AM
Nguyį»…n TĆ­n
2 Respostas
+ 5
1. Yes 2. Reasons Assertion is - for testing, - for the development phase, - for checking if interim data state are as expected. Try-except / Try-catch is - for releasal, - for the production phase, - for not harming user experience. 3. Examples https://code.sololearn.com/cBc5B5dnk7BJ/?ref=app https://code.sololearn.com/cK3pBr78iT2d/?ref=app
8th Aug 2019, 3:59 AM
Gordon
Gordon - avatar
+ 1
Assertion throws AssertionError so if assertion failed program will exit
13th Aug 2019, 7:51 AM
ExoFilm