0

I want to print out the values of lists a and b in the following format:

a[0]
b[0]
a[1]
b[1]

...

I used this

for element, link in a, b:
    print(element)
    print(link.get('href'))

(sorry for post formatting, I don't understand why stackoverflow doesnt let me post with the code fences)

but it really doesn't work, what can I do to get expected result?

DYZ
  • 51,549
  • 10
  • 60
  • 87
c-sig
  • 15
  • 5

1 Answers1

1

You can use zip for this.

for element, link in zip(a, b):
    print(element)
    print(link.get('href')
blueteeth
  • 3,110
  • 1
  • 11
  • 21