# take input
num = int(input('Enter any Number: '))
# get the first digit
while (num >= 10):
num = num // 10
# printing first digit of number
print('The first digit of number:', num)
First Digit
To retrieve the first digit from a given number
0 Comments
Add Comment
Log in to add a comment