Is this same like try and catch in c++ ? I'm not understand this exception topic in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is this same like try and catch in c++ ? I'm not understand this exception topic in python

20th Jul 2016, 5:05 PM
Anup Kage
Anup Kage - avatar
2 Answers
+ 1
I've had no prior experience with c++,so I don't know whether it's the same. The exception feature in python deals with user errors and tries to replace the ugly looking trackback error with something simpler to notify the user about the error. Say,for example that your code asks for a number input. the exception you choose could output a variety of errors, say if the user inputs a string, a float or another data type. the exception catches this error and prevents the code from further executing I hope this helped!!
21st Jul 2016, 2:22 AM
Jon Does
+ 1
yes, it's the same
15th Aug 2016, 5:08 AM
Saeed Mohagheghi
Saeed Mohagheghi - avatar