Programming Examples

Python program to find the smallest digit of a given number


Write a python program to accept a integer number form user and find the smallest digit of number.

Sample:

Input : 12341

Output : Smallest Digit is : 1

Solution

num=int(input("Enter any Number : "))
min=9
while num>0:
    digit=num%10
    if min>digit:
        min=digit
    num=num//10
print("Smallest Digit is : ",min)
Output

Enter any Number : 2315

Smallest Digit is :  1


Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad