Multiple lists


#1



It says list index out of range. Any sugesstion to pass this error?
Thank you.


for a, b in zip(list_a, list_b):
    # Add your code here!
        if(list_a[a]>list_b[b]):
            print list_a[a]
        else:
            print list_b[b]


#2

a and b contain values from the list, not the indexes:

for a, b in zip(list_a, list_b):
      print a, b

#3

this is how i came over to the next exercise


#4

https://www.codecademy.com/forum_questions/54561c36282ae3a24100443f

zip(list_a, list_b) is actually [(3, 2), (9, 4), (17, 8), (15, 10), (19, 30)]. a and b are the first and second values in each pair of numbers respectively.

You are asked to compare if:
- 3 > 2
- 9 > 5
...
- 19 > 30


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.