On Sunday 16 October 2016 16:23, 38016226...@gmail.com wrote: > c="abcdefghijk" > len=len(c) > n is a int > sb=[[] for i in range(n)] > > while (i < len) { > for (int j = 0; j < n && i < len; j++) > sb[j].append(c[i++]); > for (int j = n-2; j >= 1 && i < len; j--) // > sb[j].append(c[i++]); > } > > How to translate to python? I tried but my python code is really stupid
I don't know. What language is your code written in, and what does it do? I can guess what some of it probably does, because it looks like Python code, but the for-loops are complicated and weird. What do they do? It might help if you show the expected results. -- Steven git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space. -- https://mail.python.org/mailman/listinfo/python-list