help with a control flow tool
rogeryoung

I have been trying very hard to get the following lines of code to be looped over with a
control flow statement. It seemed like the while loop would be the choice but perhaps there
there is another tool that is used and I am very sorry that I do not understand these control
flow tools better.
I want the program to simply stop if all of the conditions in the following lines are met
but to continue on to the next line if any of these conditions are false:

vtival < float(bucket +.35bucket) or vtival > float(bucket -.15bucket)
tltval < float(bucket +.35bucket) or tltval > float(bucket -.15bucket)
iauval < float(bucket +.35bucket) or iauval > float(bucket -.15bucket)
shyval < float(bucket +.35bucket) or shyval > float(bucket -.15bucket)

I am thanking anyone who helps me with this in advance to either tell me what to do
or what I should read to understand this more fully.

You are viewing a single comment. View All
rogeryoung

This code with quit() instead of stop() stops the program whether it it is out of range or not -- stop() is not recognized.
lower_bound = float(bucket +.35bucket)
upper_bound = float(bucket -.15
bucket)
def is_within_range(n):
return n < lower_bound or n > upper_bound

if is_within_range(vtival) or is_within_range(tltval) or is_within_range(iauval) or is_within_range(shyval):
quit() @xxpertHacker