#!/usr/bin/env python # -*- coding: UTF-8 -*- l = (["a", [9999, 1, 2, 3, 0]], ["b", [5, 6, 3, 9999, 0]]) l2 = reduce(lambda x, y:x[1]+y[1], l) l2 = set(l2) l2 = tuple(l2) print l2