我有以下需要合并的数据:
tuples = ('ziyao','sa'),('guilog','sa'),('yiping','pe'),('tom','pesa'),('haha','pesa'),('hehe','pesa')
我想要的输出是:
tuples = [('ziyao','guilog','sa'),('yiping','pe'),('tom','haha','hehe','pesa')] # or 'ziyao','guilog','sa'\n'yiping','pe'\n...