Given a two Python list. Write a python program to iterate both lists simultaneously and display items from list1 in original order and items from list2 in reverse order.
belongs to collection: Python List Exercises
All Answers
total answers (1)
belongs to collection: Python List Exercises
total answers (1)
Hint:
Use the
zip()
function. This function takes two or more iterables (like list, dict, string), aggregates them in a tuple, and returns it.Solution:
zip()
function can take two or more lists, aggregate them in a tuple, and returns it.list1
and seconds argument as alist2[::-1]
(reverse list using list slicing)for
loop