I have a list and a string:
fruits = ['banana', 'apple', 'plum']
mystr = 'i like the following fruits: '
How can I concatenate them so I get
'i like the following fruits: banana, apple, plum'
Keep in mind that the enum may change size.
You can use str.join.
result = "i like the following fruits: "+', '.join(fruits)
(assuming fruits only contains strings). If fruits contains a non-string, you can convert it easily by creating a generator expression on the fly:
', '.join(str(f) for f in fruits)