I have a list in Python e.g.
names = [\"Sam\", \"Peter\", \"James\", \"Julian\", \"Ann\"]
I want to print the array in a single line withou
The following function will take in a list and return a string of the lists' items. This can then be used for logging or printing purposes.
def listToString(inList):
outString = ''
if len(inList)==1:
outString = outString+str(inList[0])
if len(inList)>1:
outString = outString+str(inList[0])
for items in inList[1:]:
outString = outString+', '+str(items)
return outString