First digit of number in python
Python program to get input num and display the first digit of number num
Sample Input 1:
Sample Output 1:
Program or Solution
n=int(input("Enter n value:")) while(n>10): n=n//10 print(n)
Given number is continuously divided by 10, till it becomes lesser than 10 and greater than 0. and the final answer is first digit of given number.