Meaning "if each item is within range of other item with the same index".
price = [1, 2]
budget = [5, 7]
This works:
if price[0] in range(budget[0]) and price[1] in range(budget[1]):
affordable = True
I figure there's some way to just reference the whole array though. Like so: if price in budget:
all; e.g.if all(price[i] in range(budget[i]) for i in range(...))orall(p in range(b) for p,b in zip(price, budget))if that's what you really want.