Is there a way in python, to compare a value in one list with the value of the same index in a second list?
For example: I want to see if the value in list1[0] > list2[0] and list1[1] > list2[1]
and do that for the entire list, but return only the values that are greater in list1
.
(Note I only want to compare a number in list1
that directly aligns with the same index in list2
. so list1[0]
is only tested against list2[0]
and not list2[1]
or list2[2]
etc.)
list1 = [100, 223, 335, 143, 218]
list2 = [75, 245, 400, 86, 500]