68. Python Program to Divide Two Numbers Safely
EasyNested if
Overview
Check input before using it.
Problem Statement
Read two whole numbers. If the second one is 0, print Cannot divide by zero. Otherwise print the first divided by the second with two decimal places. For example, for 7 and 2:
3.50
Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.
Input
One value per line, in this order. Example:
7
2
Output
The output for that example:
3.50
The tests try 3 different inputs.