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