Objective
Create a Python program that divides two numbers and always shows a final message, whether or not there is an error.
Instructions
- Read two integers,
aandb. - Inside
try, calculatea / b. - If
ZeroDivisionErroroccurs, showCannot divide by zero. - If there is no error (
elseblock), showResult: Rwith the result to two decimals. - In the
finallyblock, always showEnd of calculation.
10
2
Result: 5.00
End of calculation
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise