For my school project I need to randomly select numbers from an array to fill in captions, or I could use randomrange but i can't have any duplicates. If anyone has an idea please let me know i tried using a randomrange and obviously it generated duplicates and so I tried if statements but there are too many for me to write.
Asked
Active
Viewed 40 times
0
-
1Put the numbers into an array, shuffle the array, and then iterate the array. Otherwise, put the numbers into a list, and then run a loop that randomizes an index and removes that index from the list on each iteration. – Remy Lebeau Oct 25 '22 at 18:29