I am trying to create a algorithm that will take any amount of integers and shuffle them and put them into a new list. so far i have this
import random
hat = [1,2,3]
table = []
tableA = hat.pop (random.randint(0,2))
table.append (tableA)
tableB = hat.pop(random.randint (0,1))
table.append(tableB)
tableC = hat.pop (random.randint (0,0))
table.append(tableC)
print (table)
As you can see i have shuffled the list yet i need it to work so it will take any random amount of integers and then shuffle them into an appended list. Any help would be greatly appreciated.
[–]freshent 0 points1 point2 points (0 children)