Nov-11-2019, 12:37 AM
(Nov-10-2019, 09:09 PM)ichabod801 Wrote: 1: If you find this confusing, so does Python.1: Okay, I got it. Thank you.
3. It loops over the copy of the list, but then when it does the removal, it does that to the original list.
5. I'm not used to seeing people make copies to loop over. More often I see people building new lists:
new_list = [] for item in old_list: if is_valid(item): new_list.append(item) old_list = new_list6. I'm not sure what Python expects, but it not being safe to mess with what you are looping over is a great way to think about it.
3: The point of removing was not to slow down the program because the bullets will keep adding up. Isn't it counter-intuitive then to make a copy? because a copy of un-deleted bullets will still reside? What am I missing?
5. I need some time to understand your codes... keeping look at 'em 'til I digest but thank you.
6. Okay, got it.