def run():
lst=[]
for i in range(0,20):
ran = random.randint(1,10)
lst.append(ran)
return lst
So far I have created a list of random integers from 1 to 9 with 20 values, however how can I incorporate a swapping method so that values that are the same but not next to eachother will be next to eachother?
Thanks
Aucun commentaire:
Enregistrer un commentaire