Loading...
Loading...
Loading...
A report divides total sales by the number of orders. Read two integers a and b, one per line. Print a divided by b with 2 decimal places. If b is 0, print Cannot divide by zero.
Cannot divide by zero.Example 1
Input
10 4
Output
2.50
Normal division.
Example 2
Input
7 0
Output
Cannot divide by zero
Zero divisor.
Try the problem first. Open one hint at a time.
Dividing by zero raises ZeroDivisionError.
Catch that one error and print the message. Format the result with :.2f.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor