0
Can we use two break statement in python. For example I have given you a code and it worksđ.
Import maths n = int(input("Enter number") x = math.sqrt(n) for i in range(2,n): if x%i==0: print("it is") break else: print("it is not prime") break
1 Answer
+ 2
yes you can use break statement.
your code will iterate only once and break, because in if and else both you put break