Basic genetic algorithm codes in python