0
Can we call a function from except block in python
I have made a function name readFile(name): then calling it from except block when file name is not correct.tell me about this,how to execute this except: print() readFile(name) print() when i run this code both print statement executed but calling fun not,why ?
1 Answer
+ 9
functions can be called in except statements, I do it all the time.
I recommend testing to make sure the input argument is correct, and that the function itself is working properly with the input.