>>> filename = ['file1','file2','file3']
>>> fileprefix = 'TRE_'
>>> for item in filename: print('%s%s'%(fileprefix,item))
...
TRE_file1
TRE_file2
TRE_file3

or with list comp

>>> combined = [('%s%s'%(fileprefix,item)) for item in filename]
>>> combined
['TRE_file1', 'TRE_file2', 'TRE_file3']
>>>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to