main_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] res = [(' (s) '.join(i) + ' (s)') for i in zip(*[iter(main_list)]*4)]print(res)
Standard input is empty
['a (s) b (s) c (s) d (s)', 'e (s) f (s) g (s) h (s)']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!