def last_digit(num):
num = str(num)
return int(num[-1])
print(last_digit(-947))
I hope this helps!
5.1m questions
6.7m answers