Smallest Divisor

Description:

Write a program takes an integer and prints the smallest divisor of the integer Test Case 1 Input (stdin) 6 Expected Output Smallest divisor is: 2 Test Case 2 Input (stdin) 25 Expected Output Smallest divisor is: 5

Program :

n=int(input())

a=[]

for i in range(2,n+1):

    if(n%i==0):

        a.append(i)

a.sort()

print("Smallest divisor is:",a[0])