Mar-27-2020, 04:31 AM
(This post was last modified: Mar-27-2020, 04:32 AM by deanhystad.)
If you ran the code below what do you think it would print? If the if statement was to changed to "if i > 6:" what would it print? Answer that, without actually running the code, and you will know not only why only the first matching item in the itemslist is selected but also why the message box is not drawn.
for i in range(5): if i > 2: # Change this to 6, what is printed then? break print(i) else: print('Counted to end')What is printed? If I change the if comparison to i < 12, what gets printed then?