Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

generate a list with random length and with random numbers python

import random

def main():
    global random_int
    random_int = random.randint(5, 13)
    print random_int
    makelist(random_int)
    random_list.sort
    string = ' ' . join([str(x) for x in random_list])
    print string

def makelist(list_length):
    global random_list
    random_list = []
    for x in range (list_length):
        random_list.append(random.randint(0, 100))

main()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #list #random #length #random #numbers #python
ADD COMMENT
Topic
Name
1+3 =