Find the largest digit in a number
Write a function named largest_digit that takes an integer n as input and returns the largest digit in n. Use a while loop. Your function should also work for negative integers by considering the digits of abs(n).
Complete the supplied function in Listing 1. Keep its signature and use the checks below it.
TipHint
abs(value) returns its magnitude, so abs(-42) is 42. % gives a division remainder, and // gives the floor of a quotient. For example, 42 % 10 is 2 and 42 // 10 is 4.
assert condition stops a failed check with an AssertionError.