[Solved] How do I iterate through a list to print each variable in the list? [closed]


From your description, I think you want something like this:

>>> a = 1
>>> b = 2
>>> c = [3, 4, 5]
>>> d = [6, 7, 8]
>>> for cx, dx in zip(c, d):
        for item in (a, b, cx, dx):
            print(item)
        print("---")


1
2
3
6
---
1
2
4
7
---
1
2
5
8
---

1

solved How do I iterate through a list to print each variable in the list? [closed]