while z[0] <= D(0):
if z[1] >= z[0]:
if Fractionate(1) > 0:
while z[1] <= D(1):
if z[2] >= z[1]:
if Fractionate(2) > 0:
while z[2] <= D(2):
if z[3] >= z[2]:
if Fractionate(3) > 0:
Here I have a bunch of while loops and they're all doing the same thing. I was wondering if i could use some sort of for loop to shorten this. I can't just do
for i in range(0, k - 2):
while z[0] <= D(0):
if z[i+1] >= z[i]:
if Fractionate(i+1) > 0:
Because it only does 1 while loop at a time.
continue?