Tom Tom - 1 year ago 171
Python Question

How to stop Python 3 printing none

how do I stop this from printing none at the end. Or is it inevitable?

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

Many thanks.

Answer Source

instead of


on the last line, just do,


thats it, and it will work fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download