lundi 1 octobre 2018

Python generate random permutations of number in range

I'm trying to generate a list of 4 permutations of numbers from 1 to 8.

import random
# initialize a population of permutation
def permutation (pop_size, chrom_length):

    population = []

    #code begin



    #code end
    return population 

The pop_size variable is the length of the list, and chrom_length is the length of each permutation




Aucun commentaire:

Enregistrer un commentaire