mercredi 24 mai 2017

python making random combinations of values from two lists

I have three lists of values (numbers and letters) and I want to write a program that makes combinations of one of each lists randomly.

I found a code making all possible combinations of values and I thought that might be a good base, but now I don t know how to continue. Who can help me?

Here the code I have

import itertools

square = [a, s, d, f, g, h, j, k, l ]
circle = [w, e, r, t, z, u, i, o, p ]
line = [y, x, c, v, b, n, m ]
radiusshape = [1, 2, 3, 4, 5, 6, 7, 8, 9 ]

for L in range(0, len(stuff)+1):
  for subset in itertools.combinations(stuff, L):
    print(subset)




Aucun commentaire:

Enregistrer un commentaire