mardi 4 juin 2019

How do I create x amount of lists/sets that i can later add together?

I'm doing a project where i have to check if something is in another set and if it is then i have to combine the sets.

My question is how do i create x amount of sets with y amount of values in it.

i want to randomize this kind of data there are x sets of sets with between y1 and y2 "names" Example:

    x=5
    y1=2
    y2=4
    ["1","2","3"]
    ["6","1","2"]
    ["9","7","4","0"]
    ["6","8","1"]
    ["1","5"]

There are 5 sets of sets with between 2 and 4 "names"

Then i need to be able to put the two sets together if one value is in multiple sets, in this case it would look something like this when done:

    ["1","2","3","6","8","5"]
    ["9","7","4","0"]




Aucun commentaire:

Enregistrer un commentaire