diff options
Diffstat (limited to 'progs/a368.py')
-rw-r--r-- | progs/a368.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/progs/a368.py b/progs/a368.py new file mode 100644 index 0000000..d3171fd --- /dev/null +++ b/progs/a368.py @@ -0,0 +1,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)
\ No newline at end of file |