# 16.Multiple Lists Help me out of this..?!

<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

list_a = [3, 9, 17, 15, 19]
list_b = [2, 4, 8, 10, 30, 40, 50, 60, 70, 80, 90]

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

``<do not remove the three backticks above>``

`a` and `b` hold the lists, you can just compare them. Not sure what a(list_a) is suppose to be

To compare each pair of elements and print the larger of the two, you could do the below although your code should work fine:

`print max(a, b)`

3 Likes

I agree with bayoishola20 . The less code is better, but what if the values at the index position were the same? I believe it would be best to use the other method. For exampleâ€¦

``````list_a = [3, 1, 17, 15, 30]
list_b = [2, 4, 8, 99, 30, 40, 50, 60, 70, 80, 90]

for a, b in zip(list_a, list_b):
if a > b:
print a
elif a < b:
print b
else:
print "Numbers are the same"
``````

Also, list_b has more index items than list_a. Is there a way to print these in the same code?

4 Likes

Thatâ€™s a good point about the possibility of equal values, in which case, neither is â€ślargerâ€ť, strictly speaking. So combining the suggestions of the two solutions above, you could address this a little more succinctly like this:

``````for a, b in zip(list_a, list_b):
if a == b:
print "Values are equal, so neither is larger"
else:
print max(a,b)

``````
1 Like

no, why? a and b holds the items in the lists in turn, and then you can just compare a and b. Yes, there is some thinking left to do, since you have to remove the function calls.

1 Like

Hi @jaydacoder, really good point there.

Awesome @designcoder87342

Thank you!

Benefits of a community.

1 Like

Why does this run 4 times?

1 Like

You simply repeated the question. â€śâ€¦you can just compare them.â€ť Someone asks a teacher â€śHow do I compare lists?â€ť and the teacher says, â€śYou can just do it.â€ť Good teacher or bad teacher?

maybe not my best answer, but the second explanation is better_emphasized text_