how to prepend string to a string?

flamesrock flamesrock at gmail.com
Mon May 30 20:19:12 EDT 2005


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()    #(????????????)
#

to return
position>> depth1 >> depth2 >> depth3

rather than
position>> depth3 >> depth2 >> depth1


I really hope this feature exists =)

-thanks




More information about the Python-list mailing list