#!/usr/bin/env python2
# -*- coding: utf-8 -*-
if __name__ == '__main__':
list_a = [1, 2, 3, 7]
list_b = [3, 24, 2, -4]
# intersection
list_inst = list(set(list_a).intersection(set(list_b))) # [2, 3]
# union
list_union = list(set(list_a).union(set(list_b))) # [1, 2, 3, 7, 24, -4]
# difference
# elements in list_a, while not in list_b
list_diff = list(set(list_a).difference(set(list_b))) # [1, 7]
# elements in list_b, while not in list_a
list_diff = list(set(list_b).difference(set(list_a))) # [24, -4]