1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dmitriy555 [2]
3 years ago
5

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.
Computers and Technology
1 answer:
Vika [28.1K]3 years ago
6 0

def last_digit(num):

   num = str(num)

   return int(num[-1])

print(last_digit(-947))

I hope this helps!

You might be interested in
The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
marta [7]

Answer:.......

void clear(int *array, int length){

 

  if (length == 0)return;  

 

  array[0] = 0;  

 

  clear(array + 1, length-1);

}

Explanation:

The void function accepts an integer array.

7 0
3 years ago
Maia is typing her report on meerkats for her biology class.
dem82 [27]

Answer:

         

Explanation:

4 0
2 years ago
Why is code tracing important when debugging?
larisa [96]

It helps reveal the flow of execution of your program, including results of in-between evaluations. In other words, you can see what your program is doing, and why it takes the decisions it is taking.

If something unexpected happens, the trace will show you the sequence of events that lead to it.

7 0
3 years ago
An electric spreadsheet can perform all of the following tasks, except
motikmotik

Answer:

C. Plan worksheet objectives

Explanation:

3 0
3 years ago
_____ is the operation of setting a variable to a value.
Helen [10]

Answer:

Assignment is the operation of a variable to a value

3 0
3 years ago
Other questions:
  • When you enable user access control (uac)
    11·1 answer
  • Jenny is going on a trip to wildlife safari with her friends. She wants a camera that will help her shoot fast-moving animals. W
    15·2 answers
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    10·1 answer
  • Discuss a situation in which you might want to use a floating-point number with a fractional part for a loop control variable. W
    5·1 answer
  • The parallax perspective says that objects that are close up appear to move __________ than far away objects.
    10·1 answer
  • What operating system is an open source program
    15·1 answer
  • The benefit from dividing code into methods known as ________ is gained as follows: After you write code to perform a task once,
    14·1 answer
  • Each Google My Business location has a unique ID that applies changes to the right listing.
    11·1 answer
  • ____ is one of the primary operations of a computer.
    10·1 answer
  • State five differences between Dos and Windows.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!