I'm reading through Classic Computer Science Problems in Python (affiliate link) by David Kopec, and I'm working on his Genetic Algorithm examples....
For further actions, you may consider blocking this person and/or reporting abuse
Found this post searching specifically for GA selection techniques, just wanted to say that the choices() is great, but it's really not a roulette selection, it's just selecting 2 candidates with probability being equal to the fitness. In order to make a roulette wheel selection, you have to be a little more complex than that, mainly:
Very simple code:
This is a very simple algorithm, and there are other implementations (way faster and better), but it shows the point ;).
100%! I have found random.choice is very useful for generating test data.