Write a programElementary20 XPExercise 4/6

Is the number divisible?

Task

The program reads a line with two whole numbers separated by a space: a number and a divisor. It prints je delitelne (divisible) or nie je delitelne (not divisible).

Handle errors: if the line does not contain exactly two whole numbers, print zly vstup (bad input); if the divisor is zero, print delenie nulou (division by zero - catch the ZeroDivisionError exception). In both cases it reads a new line and tries again.

Examples

  • Input

    10 5

    Expected output

    je delitelne
  • Input

    abc 3
    10 0
    9 3

    Expected output

    zly vstup
    delenie nulou
    je delitelne

Rules

  • Handle the input with try / except.

  • The except branch is missing.

  • Catch the ZeroDivisionError exception.

After you submit, 5 hidden tests will also check your solution: not divisible, a negative number, only one number, zero as the number, three numbers.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.