Safe Division

Lab Python Beginner 10 points

Read two integers on one line. Print a / b rounded to 3 places, or cannot divide by zero.

Input

One line: a b.

Output

One line.

Example

Input

10 4

Output

2.5
Sample input available Sample output available
Editor
Python

Hints

Dividing by zero raises ZeroDivisionError.

Solution explanation

Sometimes asking forgiveness (try/except) is cleaner than checking first.

Show solution
a, b = map(int, input().split())
try:
    print(round(a / b, 3))
except ZeroDivisionError:
    print("cannot divide by zero")
Output
Answer
HOME LEARN COMMUNITY DASHBOARD