import random
old_list = [5000, 5000, 5000, 5000, 5000, 5000]
new_list = []
def random_list(old, new):
temp = []
for each_item in old:
temp.append(each_item)
chance = random.randint(0,1)
if chance < 1:
new.append(temp)
temp = []
return new
a few outputs:
[[5000, 5000, 5000, 5000], [5000, 5000]]
[[5000, 5000, 5000, 5000], [5000], [5000]]
[[5000], [5000], [5000, 5000], [5000, 5000]]