Dec-06-2018, 07:34 PM
If you want the numbers from 0 to n in random order without repeats, use shuffle:
numbers = list(range(n + 1)) random.shuffle(numbers)I don't see how you could get an IndexError, since there are no list indexes in your code. If the above does not solve your problem, please post the full text of the error.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures