0

Is there any way in python to do any thing like

if var1 < [var2 thru var3] < var4

where any variable that is in between var2 and var3 that is also in between var1 and var4 will trigger the if? I could be missing something obvious here but thanks in advance

  • do you want to do something if any of the variables match the condition? or do something for each variable matching the condition? – joel goldstick Jul 20 '16 at 23:49
  • This doesn't make sense. You're mentioning "any variable" but that's not in the code block. If you already know that `var2` and `var3` are between `var1` and `var4`, there's no point in including them. If you just want to check that `var1` is less than `var2` which is less than `var3` and so on, you can chain the comparison with `var1 < var2 < var3 < var4`. What is your actual question? – TigerhawkT3 Jul 20 '16 at 23:51

0 Answers0