last digit of number python code example
Example 1: python how to take the last digit of a number
# Python Program to find the Last Digit in a Number
number = int(input("Please Enter any Number: "))
last_digit = number % 10
print("The Last Digit in a Given Number %d = %d" %(number, last_digit))
Example 2: last digit of array python
>>> array = [0.0021, 0.12, 0.1224, 0.22]
>>> array[-1]
0.22
>>>