stb_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
passive_boxes_list = []
active_boxes_list = set(stb_list) - set(passive_boxes_list)
print active_boxes_list
I have got two lists. The number is going to be added into the passive_boxes_list dynamically (1-16).
How I can subtract stb_list from passive_box_list.
For example: if passive_boxes_list = [1 , 2 , 3] then active_box_list should be:
active_boxes_list = [4, 5,6, 7, 8, 9, 10, 11, 12, 13,14,15,16]
active_boxes_listto alistfrom aset.) Can you be more specific about what behaviour you want? If you want something that really updates dynamically, you're going to have to build a function or a class. (Also, I think the name operation is just "difference", not "distraction", in English)active_boxes_list -= set(passive_boxes_list)