so I am trying to create a list that have different list as it element the for loop bellow will extend an element to the bag then append it to the list bag and finally remove the extended element to repeat the cyclec the bag contains these elements ['B', 'D'] and the rf contains these elements ['C', 'A', 'G', 'E']
list_bag = []
for i in range(len(rf)) :
bag.extend(rf[i])
a= bag
list_bag.append(a)
bag.pop()
print(list_bag)
the out put I am trying to archive is this : [['B', 'D','A'], ['B', 'D','E'], ['B', 'D','F'], ['B', 'D','C']] but the code keep on giving me this [['B', 'D'], ['B', 'D'], ['B', 'D'], ['B', 'D']]
any suggestion ?