last_digit

Given two non-negative int values, return true if they have the same last digit, such as with 27 and 57. Note that the % “mod” operator computes remainders, so 17 % 10 is 7.

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:

7
17

Output:

True

Test 2

Input:

6
17

Output:

False

Test 3

Input:

3
113

Output:

True

Test 4

Input:

114
113

Output:

False

Test 5

Input:

114
4

Output:

True

Test 6

Input:

10
0

Output:

True

Test 7

Input:

11
0

Output:

False