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.

Answers

Answer 1

def last_digit(num):

   num = str(num)

   return int(num[-1])

print(last_digit(-947))

I hope this helps!


Related Questions

pls help quick

Question #4. This question is worth 55 points. You may use the exam reference sheet. Write the pseudocode for a procedure, pow2() that displays the nth power of 2 where n is a parameter passed into the procedure. PROCEDURE pow2 ) { }​

Answers

Answer:

The procedure is completed as follows:

PROCEDURE pow2(n){

count = 1

power = 1

WHILE count <= n

       power = power * 2

       count = count + 1

END WHILE

Print power

}

Explanation:

A pseudocode is not a real code and might not be syntactically correct. This is so because it only helps to understand what the code is all about and gives and insight of the code.

Having said that, the pseudocode for the program is as follows:

This line defines the procedure

PROCEDURE pow2(n){

This line initializes count to 1

count = 1

This line initializes power to 1

power = 1

The following iteration iterates from 1 to n

WHILE count <= n

This calculates the nth power of 2

       power = power * 2

       count = count + 1

The ends the while loop

END WHILE

This prints the calculated power

Print power

The procedure ends here

}

Note that: I'll assume that the 4 lines illustrated do not mean that the pseudocode be written in just 4 lines.

So, more lines would be needed

If you were the manager at a firm which deals with sensitive information of its customers, employees and other stake holders, how would you make sure that information is protected and is altered only by the designated authorized person

Answers

Answer:

explanation below

Explanation:

Management controls are some of the techniques and mechanisms that can be put in place to implement security policies – which ensure information and information systems are protected.  These controls are not only used by managers but can be exercised by selected users.  

These controls must be put in place to cover all forms of information security, physical security and classification of those information.  

What would be the results if the Formula =2*C8+3*D9 is entered into a cell if the value displayed in C8 is 3,and the value in cell D9 is 2? Select one: a. 3 b. 18 c. 12 d. 25

Answers

Answer:

The correct answer is:

12 (c)

Explanation:

The codes as shown C8 and D9 represent cells in an Excel spreadsheet. the cell tags describe the column letter and row numbers. For instance; C8 means the 8th row in Column C, while D9 means; the 9th row in column D. In order to do mathematical functions with Excel, the formulae starting with an equal sign (=) like the one shown in this example are used. The function is solved as follows:

= 2*C8+3*D9

where:  

* = multiplication sign (×)

C8 = 3

D9 = 2

∴ 2*C8+3*D9 = (2 × 3) + (3 × 2)

= 6 + 6 = 12

∴ the result is 12

Using the rule of thirds places items of interest in a photograph along one of the imaginary gridlines or at the point of their intersection.

True
False

Answers

I think the answer is it’s true

Answer: tureee

Explanation::)

to develop vocabulary, a student should increase their

a) use of expression

b) use of punctuation

c) oral reading rate

d) familiarity with sight words

Answers

A because you can decrease the rest and none would make sense. I learned this!!

I need the answer to life. I cant live without my POGCHAMPS!

Answers

Answer:

Pray to God and ask him for help in life. May God bless you

Explanation:

Answer:

Pog

Explanation:

Poggers

A ______ is a portable device for recording audio and video.
a. recorder
b. video
c. television
d. camcorder

Answers

Answer:

D

Explanation:

A camcorder is a portable device for recording audio and video. Thus, option D is correct.

What is video?

A video is a recording of a motion, or television program for playing through a television. A camcorder is a device or gadget that is used to record a video. audio is the sounds that we hear and mix media is a tool used to edit the video.

Digital camcorders are known to have a better resolution. The recorded video in this type of camcorder can be reproduced, unlike using an analog which losing image or audio quality can happen when making a copy. Despite the differences between digital and analog camcorders, both are portable, and are used for capturing and recording videos.

A camcorder is a self-contained portable electronic device with video and recording as its primary function. A camcorder is specially equipped with an articulating screen mounted on the left side, a belt to facilitate holding on the right side, hot-swappable battery facing towards the user, hot-swappable recording media, and an internally contained quiet optical zoom lens.

Therefore, A camcorder is a portable device for recording audio and video. Thus, option D is correct.

Learn more about recording audio on:

https://brainly.com/question/27861365

#SPJ5

HELP PLEASE SOMEONE PLEASE HELP ME!!!!!

Answers

I feel it is C, but I am not sure if it is correct, I can only apologize if it is wrong.

4.8 Code Practice: Question 2

Answers

Answer:

for y in range(88, 43, -4):

   print(y, end=" ")

Explanation;

yw

Rewritable (write, erase, write again) is known as _______.

a.
CD-R
b.
CD-RW
c.
DVD-R
d.
CD-ROM

Answers

Answer:

c

Explanation:

How many times is the coin tossed?

var heads = 0;
var tails = 0;
var rolls = 100;
for(var i = 0; i < rolls; i++){
if(randomNumber(0,1) == 0){
heads++
} else {
tails++
}
}

Answers

Answer:

100 times.

Explanation:

The code will loop until i is equal to or greater than roles. I starts at zero and increases by one after each toss.

The answer is what the other guy said

Analyze the map below and answer the question that follows. A topographic map of Northwestern Russia. Areas on the map are circled and labeled 1, 2, 3, and 4. 1 is a mountain range. 2 is a flat area. 3 is a highland area. 4 is a plateau. Image by Natural Earth The region labeled with the number 1 on the map above is the __________.

Answers

Answer:region 1

Explanation:

Answer:

region 1

Explanation:

correct on edg 2020

Given the formula on the left, label the parts. SUM . A2:D19 . E55 . (A2:A19,C13,E55,19) .

Answers

Answer:

SUM  

✔ function name

.

A2:D19  

✔ range

.

E55  

✔ value

.

(A2:A19,C13,E55,19)  

✔ argument

Answer:

1. B

2. A

3. A

4. C

Explanation:

On edge2020 I got it right

True or False? You should never move an injured person.
True
False

Answers

Answer:

true

Explanation:

In which area of the screen can features and functions of Word be accessed?

Command
Ribbon
Scroll bar
Tab

Please Hurry!!!

Answers

Answer:

Toolbar

Explanation:

j don't know if you meant that instead of scroll bar, but tool bar is the answer

Answer:

scroll bar

Explanation:

Mr. King is in an area on the taskbar opening programs he use frequently, what is this area called? Q_____ L_______h.

Answers

Answer:

Microsoft Windows. The default settings for the taskbar in Microsoft Windows place it at the bottom of the screen and includes from left to right the Start menu button, Quick Launch bar, taskbar buttons, and notification area.

Explanation:

.
Why does the Moon have a greater effect on the tides compared to the Sun? (Select WILL GIVE BRANLEST PLS ASAP

two.)
The Moon is smaller than the Sun.
The Sun is closer to the Earth.
The Moon’s gravitational pull on the Earth’s oceans is stronger.
The Moon is closer to the Earth.
The Sun’s gravitational pull on the Earth’s oceans is stronger.

Answers

The correct option that explains the reason why the moon will have greater effect on the tides compared to the sun is;

Option D; The moon is closer to the Earth

Generally speaking, ocean tides on the earth are caused by both the gravity of the moon and the gravity of the sun.

Now, the mode of generation of ocean tides is not really by the total strength of gravity, but rather by the gravitational gradient.

Gravitational gradient is simply defined as the gravity differences from one spot to the other.

Now, from research, we know that the sun is far larger than the moon and this means in consequence it will have a far stronger total gravity than that of the moon. However, due to the fact that the moon is closer to the earth than the sun, it means the moon would possess a stronger gravitational gradient than which the sun possesses.

Now, let's get to ocean tides; The ocean tides arise as a result of the response of ocean water to a gravitational gradient and as a result, the moon will have a greater role in creating tides than that which the sun does.  

Read more at; https://brainly.com/question/24996618

Which statement correctly defines the function of a servo
motor's drive?
А.
It reverses the polarity of the magnets in the motor to change its direction.
B.
It amplifies the power to speed up the motor and generate more torque.
C.
It provides feedback to the controller about the motor's position and torque.
D
It computes the value of the torque produced for a given electric current.

Answers

Answer:

B . It amplifies the power to speed up the motor and generate more torque

What is a characteristic of tasks in Outlook?
The Tasks view can be seen by clicking the View tab.

New tasks are created in the Appointments form

Tasks are an action item in Outlook and are basically a to-do list.

Old tasks are automatically deleted from your list​

Answers

Answer:

C. Tasks are an action item in Outlook and are basically a to-do list.

Explanation:

A to-do List is just a list of tasks.

and I took the test and got it right

Answer:

C. is correct

Explanation:

edg 2021

Wilma is looking for facts about social media for her research project. What fact should she use for her project? a Communicating with social media is hard b Social media is a great way to communicate. c Social media is fun and easy to use. d The minimum age for some social media sites is 13. please help me and i will give you 5 stars

Answers

Answer:

d.

Explanation:

Out of all of the options listed, the only choice that is actually a fact would be that the minimum age for some social media sites is 13. This is because this age restriction is not set by the social media sites but instead by the Children's Online Privacy Protection Act (COPPA) within the US. The other options are all personal opinion, the most accurate of which is that "Social media is a great way to communicate." which there can still be someone with an opposing argument which means that it is not factual but instead it is an opinion.

Can you guys list all the Linux Debian Apps that can only be installed on a Linux terminal command line, I have a deb 32 bit

Answers

Answer:

Two of those are apt and apt get and the other one is dpkg. 4. You will see a list of Debian Ensure package lists and installed packages are up to date. ... Apt may fail to remove old Linux kernels when using an Ubuntu version that 39 s ... To install it just enter the following command from the Terminal sudo apt install apt ...

Explanation:

Match the type of multimedia artist to the description of the jobs they perform.

storyboard artist

background artist

special effects animator

multimedia designers

works with other animators to set

the scenes depicting the key

characters

arrowRight

works with various elements to

create content for web pages

arrowRight

creates key frames that depict

all the important scenes in the

story

arrowRight

provides visual enhancements

to make the action depicted

more interesting and appealing

Answers

Answer:

d or a

Explanation:

hope it helps

JAVA
Write a program that requests the user input a word, then prints every other letter of the word starting with the first letter.
Hint - you will need to use the substring method inside a loop to get at every other character in the String. You can use the length method on the String
to work out when this loop should end.
Sample run:
Input a word:
domain
dmi

Answers

import java.util.Scanner;

public class JavaApplication42 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Input a word:");

       String word = scan.nextLine();

       for (int i = 0; i < word.length(); i+=2){

           System.out.print(word.substring(i,i+1));

           

       }

   }

   

}

I hope this helps!

The program is an illustration of loops.

Loops are used to carry out repetition operations; examples are the for-loop and the while-loop.

The program in Java, where comments are used to explain each line is as follows:

import java.util.*;

public class Main {

public static void main(String args[]) {

//This creates a Scanner object

Scanner input = new Scanner(System.in);

//This prompts user for input

System.out.print("Input a word: ");

//This gets input from the user

String userinput = input.nextLine();

//The following iterates through every other character of userinput  

      for(int i =0;i<userinput.length();i+=2) {

//This prints every other characters

          System.out.print(userinput.charAt(i));

}

  }

}

The above program is implemented using a for loop

Read more about similar programs at:

https://brainly.com/question/19104397

what isa programming language

Answers

Answer:

programming language is a formal language comprising a set of instruction that produce various kind of out put.

Answer:

A programming language defines a set of instructions that are compiled together to perform a specific task by the CPU .hope it's helps you have a great day keep smiling be happy stay safe.

guys can u help me write a program need help asp will give 25 points and brainlist if correct

Answers

import java.util.Scanner;

public class Lab04b_Numbers {

   

   public static void main(String[] args) {

       Scanner keyboard = new Scanner(System.in);

       System.out.print("Enter your GPA: ");

       double gpa = keyboard.nextDouble();

       System.out.print("Enter cost of a new car: ");

       double cost = keyboard.nextDouble();

       System.out.print("Enter average amount of rain this month: ");

       double rain = keyboard.nextDouble();

       System.out.print("What is your average for history class: ");

       double avg = keyboard.nextDouble();

       System.out.println("In 2020 a car cost $"+cost+".");

       System.out.println("Wow "+gpa+" GPA is good, but "+rain+" inches is bad.");

       System.out.println("Now only "+avg+" percent of people like tacos.");

       System.out.println("Sorry for the "+gpa+" percent who don't.");

       System.out.println(rain+", "+gpa+" or "+avg+" which do you want for a grade?");

   }

   

}

I think this is what you're looking for. Best of luck.

At the start of the school year, Brianna’s history teacher announces that students’ final grades will be weighted based on how they do in three categories: exams (60 percent), final presentation (30 percent), and class participation (10 percent). Which strategy would most likely help Brianna get the best grade? spending more time studying for exams than creating the final presentation splitting her time evenly between studying for exams and creating the final presentation concentrating on creating the final presentation and speaking up in class working hard at participating in class and studying for exams

Answers

Answer:

it is A

Explanation:

did on edge test

Answer:

A

Explanation:

In an inequality between two numbers, -2.1 is located below the other number on a vertical number line. So, the other number is -2.1. One possible value of the other number is .

Answers

Answer:

-2.0

Explanation:

Given

Number = -2.1

Required

Determine the other number

From the question, we understand that the number is represented on a vertical number.

From bottom to top, numbers on a vertical number line increases.

Since the other number is at the top of -2.1, then we can conclude that this number is greater than-2.1

Hence, possible values are ,-2.0, -1.9, etc.

Answer:

First blank: greater than.

Second bank: -1.5

Explanation:

Which of the following allows a user to quickly access a frequently used computer app? Alphabetize program icons. O Create a shortcut on the toolbar. O Delete all icons on the screen. Place all icons in one folder.​

Answers

Answer:

Create a shortcut on the toolbar

Explanation:

You can use process of elimination. alphabetizing would not help to find it quicker, but it is an easier way. Deleting all icons wouldn't help at all. And placing all icons in a folder would make it even messier. So, it is creating a shortcut. Plus, I got it right on my test :)

Answer:

its a shortcut

Explanation:

took da test and got 100

Write a for loop in python that prints 10 random numbers between 1 and 100 inclusive.

Answers

import random

for x in range(10):

   print(random.randint(1,100))

What are 5 different google g-suite tools that you can use to collaborate and communicate with othe

Answers

it is google docs like stuff made by google

Other Questions
Use the above picture to fill in the blanks for the following statement.One of the element carbon combines with one of the element oxygen to form one of the compound carbon dioxide. what the first word that comes to mind? a. i like ya cut Gb. calm down jamal dont pull out the 9c. daddy chylld. all the above Find the slope of the line on the graph. Write your answer as a fraction or a whole number, not a mixed number or decimal. Enter the correct answer. I'LL GIVE THE BRAINLIEST how do i simplify 4^(n-2)+4^(n-1)+...+4^0 which is better impostor or crew mate? what is the range of f? Which statement best describes political causes of the Yuan dynastys decline? Yuan princes argued over who would be emperor. Yuan policies made the empire open to invading armies. Yuan rulers overtaxed the Chinese, spent too much, and lost foreign battles. Yuan policies hurt traders and artisans, which weakened trade and the economy. I WILL GIVE BRAINLIEST. HURRY review the micrographs of cells shown in figure 8-3. what information about cells do these micrographs suggest, which might not be accurate? Compared to a human, what is similar about how this organism gets molecules from food and air? The measurement system used by most scientists and engineers known as the international System ofUnits is represented by the two letters. QUICK!!!!! Analyze the conditional statement below and complete the instructions that follow.If m is the midpoint of AB, then M divides AB into two congruent segments.Identify the inverse of the converse of the conditional statement.O If M is not the midpoint of AB, then M does not divide AB into two congruent segments.If M is the midpoint of AB, then M divides AB into two congruent segments.If M divides AB into two congruent segments, then M is the midpoint of AB.Olf M does not divide AB into two congruent segments, then M is not the midpoint of AB. What important item was forgotten during the inaugural process with George Washington? ANSWER ASAP PLEASE I WILL GIVE THE BRAINLIEST THINGY!!Sparky ate 2 1/2 bones in the morning and 1 2/3 bones in the afternoon. How many bones did Sparky eat all together? please help me with this work Alice rode her bicycle the same number of miles every day for 17 days. Sherode a total of 68 miles during these 17 days. At this rate, how many miles didAlice ride her bicycle in 1 day? i need help on this question A teacher is giving a lecture on the changes in world population over the last decade. Which is the best visual aid forthe teacher to use?O a bar graphO a map a line graphO a diagram please solve this i will give you brainliest What was Po'Pay's Rebellion? Please help. I really need help