Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python random distribution

#random distributer of elements in List
import random

List = [9,9,9,9,8,8,7,7,6,6,6,"G"] #my grades 
len_ = len(List)
Rand_List = []

for l in range(len_):
    rand_ = random.randint(0,len(List)-1)
    Rand_List.append(List[rand_])
    del List[rand_]

print(Rand_List)#if my grades are displaced in random order
Comment

PREVIOUS NEXT
Code Example
Python :: call methods from within a class 
Python :: how to find the summation of all the values in a tuple python 
Python :: TypeError: view must be a callable or a list/tuple in the case of include(). 
Python :: arch python 
Python :: how to make a operating system in python 
Python :: Use the correct syntax to print the first item in the fruits tuple. 
Python :: select first row of every group pandas 
Python :: why is there a lot of numbers in python 
Python :: python is instance numpy arrya 
Python :: pandas get number unique values in column 
Python :: Get git sha 
Python :: sklearn impute 
Python :: how to make take command in python 
Python :: File "main.py", line 21 print("total harga:idr", bakso bulat +str Minuman Drink): ^ SyntaxError: invalid syntax 
Python :: networkx - remove small components from a graph 
Python :: tranking de perosnas python 
Python :: create bbox R sp 
Python :: from wireframe GUI design to python tkinter 
Python :: command to update pip 
Shell :: Error: You must install at least one postgresql-client-<version package 
Shell :: uninstall k3s 
Shell :: docker remove none images 
Shell :: git username email 
Shell :: how to open xampp control panel in ubuntu 
Shell :: install nvm with brew 
Shell :: how to check windows powershell version 
Shell :: cond install opencv 
Shell :: flask restful install 
Shell :: Please install all available updates for your release before upgrading. 
Shell :: linux view services 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =