summaryrefslogtreecommitdiff
path: root/progs/a368.py
blob: d3171fddf44542c13a1ddd82a9609622933a13b7 (plain)
1
2
3
4
5
6
7
8
9
def join_tuples(test_list):
  res = []
  for sub in test_list:
    if res and res[-1][0] == sub[0]:
      res[-1].extend(sub[1:])
    else:
      res.append([ele for ele in sub])
  res = list(map(tuple, res))
  return (res)