forked from Toadoum/Random_group
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom.py
22 lines (22 loc) · 825 Bytes
/
random.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import random
ma_list =["anne","aline","gros","eve","armand","yves","elv","allo","sonia","luc","marc","jules","kevin"]
#this will contain an occurence of our list
maListOc = ma_list
#this list will contain our random list
random_list = None
groupe = 1
#for each element in ma_list, we randome and put into our variable
for i in ma_list:
#This condition will avoid errors when n is greater than 4
if(len(ma_list)<=5):
break
random_list = random.sample(ma_list, 6)
#then we remove data already randomize in our list, but the complexity is high for this little program
for element in random_list:
ma_list.remove(element)
print("Goupe N°:",groupe)
#and we finally print our randomized list
print(random_list)
print("______________________________")
groupe += 1
print(maListOc)