Last digit of integer : Given an integer number, print its last digit, Snackify.org python code

 

CODING QUESTION

Given an integer number, print its last digit.  


SOLUTION

# Read an integer:
# a = int(input())
# Read a float:
# b = float(input())
# Print a value:
# print(a, b)
x=int(input())
print(x%10)

 

Input: 178

Output: 9