![]()  | 
	
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
				
				Array Question
			 
			
			
			Hi All, 
		
		
		
		
		
		
		
		
	
	I am trying to create a program whereby an element is selected from an array and then a new array (minus the selected object is then created). E.g. Speed = [30,40,50,60] target_speed = random.choice(Speed) Speed = Speed-target_speed Obviously the last line is incorrect - can anyone suggest how this can be done? Thanks  | 
| 
		 
			 
			#2  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
		
		 
			
			Solved the issue - for anyone who wants to know for the future... 
		
		
		
		
		
		
		
		
	
	Code: 
	No_probe_vehicle = 20 # number of trials Speedarray = ([30,30,30,30,40,40,40,40,50,50,50,50,60,60,60,60]) for j in range (0,No_probe_vehicle): probe_speed = random.choice(Speedarray) Speed[1] = probe_speed*(1609.44/3600) print "Probe Speed", probe_speed print "Speed Array", Speedarray Speedarray.remove(probe_speed) print "speed", Speed  | 
![]()  | 
	
	
		
  | 
	
		
  | 
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| how to invoke command line question | billjarrold | Vizard | 2 | 01-11-2010 09:51 AM | 
| Semi-circle array containing target and distractor objects | ptjt255 | Vizard | 3 | 08-04-2009 04:09 AM | 
| 2D or 3D array help? | durf | Vizard | 1 | 02-20-2009 11:57 AM | 
| General question and question regarding arrays | dan12345 | Vizard | 1 | 01-15-2008 11:15 AM | 
| Copy objects in an array to another array | Johannes | Vizard | 3 | 04-29-2005 03:37 PM |