You can get the required output by using range
mylist = ['X', 'Y', 'Z'] allvar = '' for char in mylist: allvar += char print (allvar) XYZ