Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
        
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #exit #loop #python
ADD COMMENT
Topic
Name
8+4 =