[Solved] List with sublists inside [closed]


>>> from random import randint
>>> n = 10
>>> a = [0]*n // initialise array a wwith exactly n zeros
>>> a
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>> i = randint(0,n-1) // get random number from 0 to n-1
>>> i
1
>>> a[i]=n //assign a[i] to n
>>> a
[0, 10, 0, 0, 0, 0, 0, 0, 0, 0]

solved List with sublists inside [closed]