if in a for loop, I have a variable, it doesn't change for 30 times, I will stop the loop.
for i in range(100):
if b > a:
c= 0
if b < a:
c = 1
If c stays at 0 continually for more than 30 times,then I will stop it. How to write code for this part?
I am thinking using list to record them, if sum(i for i in c[-30:]) is 0.
Is there any other decent way to express this? Thank you~
count > 30?