On Thursday, June 23, 2016 at 4:17:23 PM UTC+12, Elizabeth Weiss wrote:
> 
> i=0
> while 1==1:
>    print(i)
>    i=i+1
>    if i>=5:
>      print("Breaking")
>      break
> 
> Why is Breaking going to be printed if i only goes up to 4? It does say if
> i>=5?

Because you incremented i after printing its value, and before checking it.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to