Random numbers generator list with Mean, Median, Mode and frequency of each number
    import random
    import numpy
    from statistics import mode
    import csv
    
    #create list
    list=[]
    
    ##random numbers
    for i in range (100):
        number= (random.randint(0,10))
        #add to list
        list.append(number)
    
    print("Random numbers: "+(str(list)))
    list.sort()
    print("Numbers sorted: "+(str(list)))
    
    #Mean, median and mode of list
    mean1=numpy.mean(list)
    median1=numpy.median(list)
    mode1=mode(list)
    
    print("The mean of the numbers is "+(str(mean1)))
    print("The median of the numbers is "+(str(median1)))
    print("The mode of the numbers is "+(str(mode1)))
    
    ##frequency method
    
    ##dictionary
    frequency = {}
    
    # iterating over the list
    for item in list:
       # checking the element in dictionary
       if item in frequency:
          # incrementing the counr
          frequency[item] += 1
       else:
          # initializing the count
          frequency[item] = 1
    
    # printing the frequency
    print(frequency)
    
    ##Export dictionary to CSV file
    with open('numbers.csv', 'w') as f:
        for key in frequency.keys():
            f.write("%s,%s\n"%(key,frequency[key]))