+ 5
Random number
How do I make a random number generator that endlessly makes but The numbers are always different. Please help. :) thanks
5 Answers
+ 3
Every random number you add to an array and if another random number = that then you choose another random number until its an unique value
+ 3
Cbrâ[ Most active ] Take a look at the tags.
+ 1
Hi. I googled for you. Here is the link for the solution on stackoverflow.
https://stackoverflow.com/questions/22842289/generate-n-unique-random-numbers-within-a-range
+ 1
You could use random.uniform(a, b) (returns a float) with a huge range but still wouldn't guarantee a unique value every single time. You could append the number to a list and check if any newly generated number is in the list before you return/yield it... but...endlessly!.....that list will be huge. Gook luck with that one.