How make the judge with for loop?

380162267qq at gmail.com 380162267qq at gmail.com
Sun Oct 16 01:23:29 EDT 2016


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



More information about the Python-list mailing list