Following is my code. I want to append the ip:port string by a comma separated list.
ip = ['1.1.1.1', '2.2.2.2', '3.3.3.3', '4.4.4.4']
memcache = ''
port = '11211'
for node in ip:
memcache += str(node) + ':' + port
# join this by comma but exclude last one
I want output in this format:
memcache = 1.1.1.1:11211, 2.2.2.2:11211, 3.3.3.3:11211, 4.4.4.4:11211
How can I achieve that?