0

python question abut error

hello, I wrote the folowwing code: https://code.sololearn.com/351/#py it supposed to present an error in case the input is < 0 but it does not. whats the problem? thank you

29th Oct 2017, 1:22 PM
Dariush Shiri
Dariush Shiri - avatar
1 Odpowiedź
+ 3
The 'raise' keyword is used to make an exception (throw an error) and expect an error object to be raised... so if your code intercept an error, it would print your message and then make another unintercepted error: it seems that without an custom error object the actual error intercepted is raised again ^^
29th Oct 2017, 1:45 PM
visph
visph - avatar