Why does a work and b doesn't? What I was trying to accomplish with b is to get a random list (of random length) that could have digits repeat.
I got idea for both methods from the Internet. I do see that one uses brackets and the other doesn't, but I don't know the difference. import random for i in range (5): a = random.sample(range(10), random.randrange(3,6)) print a for i in range (5): b = [random.randrange (10), random.randrange(4,8)] print b -- https://mail.python.org/mailman/listinfo/python-list