close_10

Given 2 int values, return whichever value is nearest to the value 10, or return 0 in the event of a tie. Note that Math.abs(n) returns the absolute value of a number.

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

8
13

Output:

8

Test 2

Input:

13
8

Output:

8

Test 3

Input:

13
7

Output:

0

Test 4

Input:

7
13

Output:

0

Test 5

Input:

9
13

Output:

9

Test 6

Input:

13
8

Output:

8

Test 7

Input:

10
12

Output:

10

Test 8

Input:

11
10

Output:

10

Test 9

Input:

5
21

Output:

5

Test 10

Input:

0
20

Output:

0

Test 11

Input:

10
10

Output:

0