B
B
boda10062021-08-06 17:36:51
Python
boda1006, 2021-08-06 17:36:51

Output words from 2 lists in 1 message?

Hello I want to print 2 lists together in python Example: 1store name 2[address]
tried for i in range(0, len(names)) and j in range(0, len(adres)):
print(nsmes[i] + "" + cenas[j])
but doesn't work, can you please help with that.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom, 2021-08-06
@boda1006

a = ["1", '2', '3']  # Списки с данными
b = ['4', '5', '6']

c = zip(a, b)  # Эта функция склеит 2 списка в список кортежей
for a_1, b_1 in c:
    print(f"Название: {a_1}; место: {b_1}")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question