mirror of
				https://github.com/pocketpy/pocketpy
				synced 2025-10-31 17:00:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			568 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			568 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| icon: package
 | |
| label: random
 | |
| ---
 | |
| 
 | |
| ### `random.seed(a)`
 | |
| 
 | |
| Set the random seed.
 | |
| 
 | |
| ### `random.random()`
 | |
| 
 | |
| Return a random float number in the range [0.0, 1.0).
 | |
| 
 | |
| ### `random.randint(a, b)`
 | |
| 
 | |
| Return a random integer in the range [a, b].
 | |
| 
 | |
| ### `random.uniform(a, b)`
 | |
| 
 | |
| Return a random float number in the range [a, b).
 | |
| 
 | |
| ### `random.choice(seq)`
 | |
| 
 | |
| Return a random element from a sequence.
 | |
| 
 | |
| ### `random.shuffle(seq)`
 | |
| 
 | |
| Shuffle a sequence inplace.
 | |
| 
 | |
| ### `random.choices(population, weights=None, k=1)`
 | |
| 
 | |
| Return a k sized list of elements chosen from the population with replacement.
 |