In python you can use:
try:
#some code
except Exception as e:
print e
And this will automatically catch any exception. Lets say you want to make a simple division in '#some code"...
variable = int(raw_input('Input: '))
result = 50/variable
Now, imagine somebody enters 0, or a letter, or even a string... As far as I know, since we used the generic exception catch, all of this will be taken care of and thus the code will jump to the except block, avoiding a crash.
In C++, you would have to check that the input is a number in one IF statement, and then check that it is not zero in another one, and if that's the case, throw the corresponding exception/s.
int var = 0, result = 0;
try{
cin >> var;
if (var == 0)
throw "Zero Division Error";
result = 50/var;
}catch(...){
//exception handling code
}
All of this, (although untidy, and a bad practice), could have been done simply with pure IF-ELSE statements, without the try-catch block. However, in C++, should any unexpected exception occur, you are done. You have to manually take care of every exception, adding throw statements for every possible case, whereas in python, this is done automatically for you, and it even tells you what went wrong, and what kind of exception your generic variable 'e' caught.
So the question is:
Is there a way to write a try-catch block in whatever version of C++, that automatically takes care of any exception and assign it to a generic variable for you to print?
Because if there is not, I don't see the purpose of using the try-catch structure, other than making your code look tidy and more organized (same with the switch statement).