LearnPy Hub
← Functions problems
Medium

Divide and Report

Write divide(a, b) that returns a tuple (True, result) or (False, 'cannot divide by zero'). Read n pairs and print the result with 2 decimals or the message.

Input

n, then n lines a b.

Output

n lines.

Sample 1

Input
2
10 4
5 0
Output
2.50
cannot divide by zero

Sample 2

Input
1
1 3
Output
0.33
solution.py
Output appears here
Divide and Report · Python practice problem · LearnPy Hub