D
D
dancer_and_programmer2020-06-06 18:31:20
Python
dancer_and_programmer, 2020-06-06 18:31:20

How to display data from two lists?

There are 2 lists:

f = ['1', '2', '3', '4', '5']
s = ['раз', 'два', 'три', 'четыре', 'пять']


How to output in this format:
1 = раз
2 = два
3 = три
4 = четыре
5 = пять


I tried, but for some reason it is displayed so many times. Tell me, what's wrong?
for i in range(len(f)):
    for j in range(len(s)):
        print(f[i], '=', s[j])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-06-06
@dancer_and_programmer

print('\n'.join(map(' = '.join, zip(f, s))))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question