Hi all,
Probably a simple one for someone!
I'm abusing Python to sort my sheep for breeding (prevent inbreeding).
I have a list which holds the ids of all the ewes, this id can be used by the program to look up the sire, dam, grandsires and grand dams from my sheep database.
As I check for relationship with the rams I'm going to use, the ewes ID is removed from the breeding list if it isn't related.
I use the list.remove(ewe) method to remove the ID from the list.
This works fine until I get to 11 elements left in the list the it throws out of the loop.
The loop is
for ewe in ewelist:
(Code to check for relationship)
ewelist.remove(ewe)
ramgroup.append(ewe)
Have I got something obviously wrong here? I can post full code when I'm at the computer but I'm not great at Python so thought it could be obvious
Cheers Geoff
Probably a simple one for someone!
I'm abusing Python to sort my sheep for breeding (prevent inbreeding).
I have a list which holds the ids of all the ewes, this id can be used by the program to look up the sire, dam, grandsires and grand dams from my sheep database.
As I check for relationship with the rams I'm going to use, the ewes ID is removed from the breeding list if it isn't related.
I use the list.remove(ewe) method to remove the ID from the list.
This works fine until I get to 11 elements left in the list the it throws out of the loop.
The loop is
for ewe in ewelist:
(Code to check for relationship)
ewelist.remove(ewe)
ramgroup.append(ewe)
Have I got something obviously wrong here? I can post full code when I'm at the computer but I'm not great at Python so thought it could be obvious
Cheers Geoff