vendredi 28 décembre 2018

Create a random list from 0-100 with different lengths

I want to generate a list from 0-100 but my criteria is as follows:

  1. The list must start with 0 and end with 0.

  2. No 0 in between.

  3. Different lengths

for example:

ex1.

    print(generated_list)

    [0,1,3,5,6,7,6,8,9,0]

ex2.

    print(generated_list)

    [0,4,7,8,3,4,9,12,44,2,11,56,32,99,0]




Aucun commentaire:

Enregistrer un commentaire