I am using the all
function to compare list items to see if they are less than or equall to 10 of each other. I am testing to see if the values in l2 is 10 lower than value in l1. But I am getting a syntax error.
l1 = [10, 20, 30, 40, 50]
l2 = [50, 75, 30, 20, 40]
all([result for x,y in l1,l2 if x - y<=10 ])
SyntaxError: invalid syntax
all([result for x,y in l1,l2 if x - y<=10 ])