+ 1

Hpw does the "try" work in python?

14th Mar 2020, 9:00 PM
Damanjeet Singh
Damanjeet Singh - avatar
4 Antworten
+ 3
You simply wrap code in try block that might throw an Exception, for example division by zero will throw an exception. Try block is followed by except keyword which will handle exception. This all is used to not crash your program
15th Mar 2020, 7:53 AM
Viktor Sokolov
Viktor Sokolov - avatar
14th Mar 2020, 9:06 PM
Kevin ★
+ 2
Used to handle exceptions in a way that the program is not terminated when one is encountered.
15th Mar 2020, 1:32 PM
Sonic
Sonic - avatar
+ 1
Thank you
15th Mar 2020, 8:28 AM
Damanjeet Singh
Damanjeet Singh - avatar