[[1, \'34\', \'44\'], [1, \'40\', \'30\', \'41\'], [1, \'41\', \'40\', \'42\'], [1, \'42\', \'41\', \'43\'], [1, \'43\', \'42\', \'44\'], [1, \'44\', \'34\', \'43\']
from functools import reduce out = list(reduce(set.union, iterable))
as long as at least the first the element of iterable is a set. Otherwise,
iterable
out = list(reduce(set.union, iterable[1:], set(iterable[0])))