input: Write a python function to generate the powerset of a given set.
  assert powerset({1, 2, 3}) == [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]
  assert powerset({1, 2}) == [(), (1,), (2,), (1, 2)]
  assert powerset({}) == [()]
output: def powerset(s):
      from itertools import chain, combinations
      s = list(s)
      return [tuple(subset) for subset in chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))]