Python Chapters

Python Program for the right most digit of a number.

Structure of Python Program - Overview
Num = input("Enter Number :")

Right_Num = Num % 10

print "\n\nThe right most digit is :" , Right_Num

Output :
Enter Number : 123

The right most digit is : 3

Description :

Modulo (%) operator gives reminder of division of two numbers.
So Reminder of 123/10 is 3 the right most digit.


Leave a comment
Recent Comments
No Comments