Python: range doesn't increase
<p>I have to write a program that shows a column of kilograms and a column of pounds, starting at 1 kilogram and ending 99, increasing every step with 2.</p>

<p>I have the following code, and the range() works for the pounds part, but not for the kilograms part. It stays always 1 for the kilograms.</p>

<pre><code>for k in range(1,3,1):
    print("Kilograms","Pounds",sep="        ")
    for i in range(1,101,2):
       for j in range(2,223,3):
           print(i,"",j,sep="        ")
       break
    break
</code></pre>

<p>Also, why can't I use floats in the range, because officially it is 2.2 pounds.</p>

<p>Thanks in advance!</p>

<p>Because you use <code>break</code> with in a loop.</p>

<p>In python you don't end a loop with anything but a decreased indentation. Remove your <code>break</code> statements and try again.</p>

<p>The <code>break</code> statements ends the current loop unconditionally. For example,</p>

<pre><code>s = 0
for i in range(1, 101):
    s = s + i
</code></pre>

<p>will make <code>s</code> equal to 5050. However, if you break it some where, like</p>

<pre><code>s = 0
for i in range(1, 101):
    s = s + i
    if i == 5:
        break
</code></pre>

<p><code>s</code> will stop increasing on 15.</p>

<p>As commentors say, you should learn the basics of python from some tutorial. There are pretty many free tutorials on the internet. Don't haste.</p>

<p>Besides, if you wanna use float steps in ranges, take a look at <a href="http://stackoverflow.com/questions/477486/python-decimal-range-step-value">this answer</a>; or rather, see comments below for a simple answer.</p>

python for-loop