Q:

Printing first N natural numbers function not working

Why is this python code returning 1 for any input?
#code for a function which prints the first n natural numbers
n = raw_input("Enter n")
n = int(n)
def printint(p):
  for i in range(1 , n+1):
    return i 
print printint(n)

A:

What you want is to print the numbers, not to return them:
def printint(p):
  for i in range(1 , p+1):
    print i

Then just call the function alone, since it is printing inside:
printint(n)

Here you have a live example
EDIT: Your final code should look like this:
def printint(p):
  for i in range(1 , p+1):
    print i
n = int(raw_input("Enter n"))
printint(n)

