0

The answer is WRONG!

try: variable = 10 print (10 / 2) except ZeroDivisionError: print("Error") print("Finished") The answer is : 5.0 The answer is NOT : 5.0 Finished

29th Apr 2017, 1:08 PM
Alwi Shaik Delgado Alaudinq
5 Respostas
+ 18
The answer is- 5.0 Finished I checked it.
29th Apr 2017, 1:21 PM
Sachin Artani
Sachin Artani - avatar
+ 8
Why would the "Finished" part not get printed? It is outside the try/except clause...
29th Apr 2017, 1:15 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Python always makes you reconsider the wrong choice of using 2 instead of 4 spaces indents....
29th Apr 2017, 1:31 PM
seamiki
seamiki - avatar
0
4 spaces indents and append Finally: before your last line. also if zerodivisionerror is calling, the answer will be Error Finished
29th Apr 2017, 10:24 PM
MBZH31
MBZH31 - avatar
0
indentation is very much important as far as python is concerned.. make sure ur indentation is right to get the correct answer..
2nd May 2017, 4:57 AM
Harsha Vardhan
Harsha Vardhan - avatar