#1
|
|||
|
|||
Random array
Is there any way I can create an array of
Continuous random sort it thank all !! |
#2
|
|||
|
|||
You can use one of the functions from Python's random module to generate random numbers and place those in a list. Lists have a sort method you can use to sort the elements within.
Code:
import random numbers = [] for i in range(1,10): number = random.randint(1,10) numbers.append(number) print numbers numbers.sort() print numbers |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
random coding | Saz | Vizard | 1 | 05-27-2010 05:44 PM |
random speed and associated coding | Saz | Vizard | 1 | 05-20-2010 04:03 AM |
Semi-circle array containing target and distractor objects | ptjt255 | Vizard | 3 | 08-04-2009 03:09 AM |
Random head movements | VR_enthusiast | Vizard | 2 | 07-19-2006 11:59 AM |
Copy objects in an array to another array | Johannes | Vizard | 3 | 04-29-2005 02:37 PM |