Genetic algorithm written in python