Q:

Python: How do I remove the formatting when joining items from a list into a string?

Good morning, all:
I'm working on a small Python program which matches together small strings in order to make up fictional company names. The name segments are stored in three lists, and a random string from each list is chosen each time a new name is requested. For example, the program might pick "Eli", "rce" and "Softworks" from the three lists, which would give me "Elirce Softworks".
seg1 = namesegs1[random.randint(0, seg1_length)]
seg2 = namesegs2[random.randint(0, seg2_length)]
seg3 = namesegs3[random.randint(0, seg3_length)]
new_name = "{0}{1} {2}".format(seg1, seg2, seg3)

However, the code actually returns ['Eli']['rce'] ['Softworks']. It makes sense, given that it's joining items from lists, but I don't see why these can't be removed in some way or another.
Here's one way I've made it work:
new_name = new_name.replace("'", "")
new_name = new_name.replace(",", "")
new_name = new_name.replace("[", "")
new_name = new_name.replace("]", "")

That gets rid of the formatting nicely, but it's less than satisfactory and it feels like I'm doing it wrong. Is there a better way to be going about this?
Many thanks for your time.

A:

It looks like namesegs1 is a list of lists rather than a list of strings.  
What do you get with the following?
new_name = "{0}{1} {2}".format(seg1[0], seg2[0], seg3[0])

By the way, use random.choice(namesegs1) to select a random item from your list, rather than that thing you've done with random.randint.

