i'm struggling with this seemingly simple python problem.
i need 90 values in the list that increase by 6 (from 120) until it reaches 240, once it reaches 240 it should decrease by 6 back to 120. this loop would continue until 90 values are reached.
x = [30, 36, 42, 48, 54, 60]
e = [120]
for row in range(90):
if e[row] >= 120 and e[row] != 240:
e.append(e[row] + 6)
print(e[row], "1")
elif e[row] <= 240 and e[row] != 120:
e.append(e[row] - 6)
print(e[row])
the code i have so far doesn't work well. after it reaches 240, it goes down to 236. 236 satisfies the >= 120
and != 240
condition so it just goes back up to 240.
any guidance would be appreciated!