how to exit a if loop in python code example
Example: how to exit a loop in python
print("enter a number")
num=int(input())
for i in range(2,num+1):
if(num%i==0):
print("smallest divisor is",i)
break
print("enter a number")
num=int(input())
for i in range(2,num+1):
if(num%i==0):
print("smallest divisor is",i)
break