Message 11290 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
Logged In: YES 
user_id=566423

Of course, with a correct indentation, it is:

def flatten(L):
    for i in L:
        if type(i) == list:
            for j in flatten(i):
            yield j
        else:
            yield i

def mklist(n):
    if n:
        return [ str(n), mklist(n-1), str(n) ]
    else:
        return [] 

L = mklist(6)
print "".join(flatten(L))