flamesrock wrote: > so I know you can append a string. But how do you *prepend* a string, > as shown in the following code > > #dirList = ['depth1','depth2','depth3'] > #string = """position""" > #for x in len(dirList): > # string += '>> %s'%dirList.pop() #(????????????) > #
How about string = whatever + string? Note that recommended form is to build a list of strings and then use ''.join(all_my_strings) to form the final result. After saying all that, here's a better way: dirList = ['depth1','depth2','depth3', 'position'] print ' >> '.join(dirList) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list