Python - Removing whitespace on output
<p>So, I have this code:</p>

<pre><code>print("%d" % a, end=(" "))
</code></pre>

<p>It works, but in the output, there's a whitespace after the last number. I need to get rid of the last whitespace. My output needs to be shown on the same line, separated by a blank space. There should be no space after the last value.</p>

<p>Here's an example: (n is input, so suppose n = 5)</p>

<pre><code>0 1 1 2 3
</code></pre>

<p>I've tried .strip, .join, but none of them worked. What do i have to do to get the right output? I'm sorry if this is too much of a simple question, I'm new in python.</p>

<p>edit: edit2:</p>

<pre><code>a, b, i = 0, 1, 0
n=int(input())
for j in range(0, n):
    while i &lt; n:
        print("%d" % a)
        a, b = b, a + b
        i += 1
</code></pre>