Random Function Bias Tester
Hard coding your data can be lengthy and it can restrict flexibility when carrying out further analysis. You can shorten your code with list comprehension. 

import random

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

def main(val):
  ls = [i for i in random.choices(n, k=val)]
  ns = sum(ls)/len(ls)
  print('Length of Data : {}\nSum of Data    : {}\nAverage of Data: {}\nRandom Gen Data: {}'.format(len(ls), sum(ls), ns, ls))

main(100) #Enter amount of data you want to pass through the function


This returns:

Length of Data : 100
Sum of Data    : 399
Average of Data: 3.99
Random Gen Data: [7, 4, 0, 8, 8, 0, 6, 7, 6, 4, 7, 0, 0, 0, 9, 4, 3, 0, 0, 7, 0, 4, 6, 5, 3, 0, 6, 0, 7, 0, 0, 4, 3, 7, 7, 9, 5, 3, 5, 2, 0, 4, 1, 1, 5, 8, 9, 0, 3, 2, 7, 5, 3, 3, 3, 3, 7, 5, 7, 5, 7, 1, 6, 2, 7, 7, 5, 1,6, 6, 4, 7, 8, 2, 0, 1, 5, 3, 5, 4, 9, 7, 7, 2, 0, 3, 4, 6, 3, 4, 3, 5, 6, 3, 0, 1, 3, 8, 0, 1]


It isn't necessary to use a while loop in this instance because you will still need to break your loop which is the same as giving a start and end value to a random range reference.