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