Write a function named last_digit that returns the last digit of an integer. For example, last_digit(3572) should return 2. It s
hould work for negative numbers as well; last_digit(-947) should return 7.
1 answer:
def last_digit(num):
num = str(num)
return int(num[-1])
print(last_digit(-947))
I hope this helps!
You might be interested in
Last week, Nate and I counted all the inventory. answer :A
Answer:
what exactly is the question because I don't see anything
Answer: responsive
Explanation:
its called mobile responsivness and most good websites have it
B false data does not only have to be facts
Answer:
jskjsjsjsjskdmsnjsnsnsns