擅长:python、mysql、java
<pre><code>#First you need to define your center_x. You may get this value from some other
#function in your script. I will use 160 as a valid example
center_x = 160
#You need to define initial value of x outside of the loop so it does not "reset"
x = 200
if 150 <= center_x <= 180:
while x <= 600: #Here you set the limit of where you want to stop adding. I used 600 as example
x += 100
print(x) #There is no need to set a MESSAGE variable, you can directly print the x variable
</code></pre>