0
Exception handling
try: def labas(x): xx = 0 for i in range(x): xx += i return xx print(labas(5)) except IndentationError: print("code error") As sample this code I wrote wrong in purpose. So by try and except statements I should get output 'code error', but I didn't get any output. How these statement are works? Should I proper name except statement, with proper mistake name? I f yes what purpose of these statements? If I know what I'm doing wrong and what mistake I gonna do. I don't know is it my question is clear. Thanks
1 Antwort
+ 1
I also checked and was wondering what was happening ,so this is it if I am not wrong!
https://www.tutorialspoint.com/How-to-catch-IndentationError-Exception-in-JUMP_LINK__&&__python__&&__JUMP_LINK