1

I have two lists:

names = ['some_name', 'other_name']
status = ['queued', 'in-progress']

how can I join them to look like this:

list = ['some_name queued', 'other_name in-progress']
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Łukasz Kwieciński
  • 14,992
  • 4
  • 21
  • 39
  • 1
    Does this answer your question? [How to concatenate element-wise two lists in Python?](https://stackoverflow.com/questions/19560044/how-to-concatenate-element-wise-two-lists-in-python) – DYZ Jun 04 '20 at 21:41

1 Answers1

2

Here is one way:

names = ['some_name', 'other_name'] 
status = ['queued', 'in-progress']

result = ['{} {}'.format(name, status) for name, status in zip(names, status)]

print(result)

Output:

['some_name queued', 'other_name in-progress']
Isma
  • 14,604
  • 5
  • 37
  • 51