break out of for loop in while loop python code example Example: break function python if( x > 3): print('X is greater than 3') else: break