How to stop Python 3 printing none
<p>how do I stop this from printing none at the end. Or is it inevitable? </p>

<pre><code>x = int(input("Please enter a number to print up to."))
def print_upto(x):
for y in range(1,x+1):
    print(y)
print(print_upto(x))
</code></pre>

<p>Many thanks.</p>

<p>instead of </p>

<pre><code>print(print_upto(x))
</code></pre>

<p>on the last line, just do, </p>

<pre><code>print_upto(x)`
</code></pre>

<p>thats it, and it will work fine.</p>

python