lundi 7 juin 2021

How to generate a random array as followed using python

How to generate a random list as the followed descripition

The random number range from 0 to 4. Assume the list named arr,

arr[0]!=1; arr[2]!=[3]; arr[4]!=[5];arr[6]!=[7];........

However, it's okay if arr1=arr[2];arr[3]=arr[4];arr[5]=arr[6]........

eg: arr = [1,2,2,0,3,2,1,3,0,1,1,0]




Aucun commentaire:

Enregistrer un commentaire