T
T
tea4panda2020-07-08 09:45:31
Python
tea4panda, 2020-07-08 09:45:31

Python. How to add list elements by index?

Hello!
Tell me, please, how can I add the elements, let's say two such lists?
[privet, privet2, privet3]
[poka, poka2, poka3]
to get:
privet + poka
privet2 + poka2
privet3 + poka3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-07-08
@tea4panda

[ ' '.join(n) for n in zip(list1, list2) ]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question