kevinbaldridge9902 kevinbaldridge9902
  • 12-11-2020
  • Computers and Technology
contestada

Write a function named last_digit that returns the last digit of an integer. For example, last_digit(3572) should return 2. It should work for negative numbers as well; last_digit(-947) should return 7.

Respuesta :

Cytokine
Cytokine Cytokine
  • 12-11-2020

def last_digit(num):

   num = str(num)

   return int(num[-1])

print(last_digit(-947))

I hope this helps!

Answer Link

Otras preguntas

Please help me answer these question
A local band sells out for their concert. They sell all 1,175 tickets for a total purse of $28,112.50. The tickets were priced at $20 for student tickets, $22.5
Given x+2y=-6 solve for y y= x-6/2 y= -x+6/2 y= -x-6/2
Please anyone help me ​
Help please!Solve for x​
please help! the subject is 9th-grade geometry honors I need help finding the length for this problem.
write any two adaptational characteristics of the plants found in mountain region​
In May, Ali was charging $20 for individual basketball lessons and in August started charging $25. What percent did she increase her prices?
Help bell buissness help bell bel
First the first 4 term for 4n-5