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

BRAINLIEST AND 25 POINTSSSS identify key ideas and influences of Jacksonian Democracy compare principles of U.S. constitutional government identify major econom
Isaiah decides to launch a model rocket to demonstrate parabolic motion. Given x stands for time and y stands for height in feet, find the equation for his rock
Make a title for this short paragraph and write a statement that is your opinion about the paragraph.
17. El chico _____ una carta para su novia,
Which season is signaled by average lower temperature and indirect, angled sunlight?Group of answer choiceswinterfallsummerspring ( PLS ANSWER ASAP I WILL MARK
When using estimates to make decisions, A. It is important to always use a 95% confidence level B. It is important to remember that you will never achieve certa
A student is investigating the strength of electromagnets she created using batteries, wire, and nails. She uses two different-sized nails and varies the number
Sound can't travel through a Question 4 options: A. liquid. B. vacuum. C. solid. D. gas.
John's parents deposited $1000 into a savings account as a college fund when he was born. How much will John have in this account afer 18 years at a yearly simp
Pls pls pla help it lol