Created
December 27, 2011 21:05
-
-
Save bjcubsfan/1525104 to your computer and use it in GitHub Desktop.
looping over and deleting items in a list (bad things happen)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pdb | |
expected_rngs = range(0,10) | |
file_list = [1, 2, 3, 4, 5, 6, 8, 9] | |
for antenna in expected_rngs: | |
print "*********************************************************************" | |
print "Checking", antenna | |
for rng in file_list: | |
print "checking", rng | |
if rng == antenna: | |
expected_rngs.remove(antenna) | |
print "removing", antenna | |
break | |
print "*********************************************************************" | |
print "*********************************************************************" | |
print expected_rngs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment