def get_list():
myList = ['1','2','a','b']
return myList
print get_list()
pyTony
pyMod
6,309 posts since Apr 2010
Reputation Points: 879
Solved Threads: 986
Skill Endorsements: 26
If you want to convert lists (tuples) to strings using the same string between each item, such as ZZucker suggests, you should use the join method on a string, as for instance:
my_list = ['one', 'two', 'three', 'the end']
print('\n'.join(my_list))
which results in this output:
one
two
three
the end
griswolf
Veteran Poster
1,176 posts since Apr 2010
Reputation Points: 344
Solved Threads: 262
Skill Endorsements: 1