0
x = 2 while x < 400: print(x) x = x ** 2 while True: print(x**2, end=" ") if x == 400: break x = x **
Why this keeps printing and why doesn't accept break?
2 Answers
+ 3
You have placed your code in question title instead of linking it in description
+ 1
2 ** 2 ---> 4
4 ** 2 ---> 16
16 ** 2 ---> 256
256 ** 2 ---> 65536
When the first loop broke the x was 65536.
The second loop would break only if x == 400, but x were never equal to 400.