The function raw_input() returns a string, and then you are passing that string onto the function func().
In func() , in the condition for the while loop, you are checking an int against a string.
In Python 2.x , any int is always smaller than any string , hence the loop goes on forever. Example -
>>> 12323123123123121 < '1'
True
You should convert the input to an integer before giving it to the function (or directly when taking the input) . Example -
y = int(raw_input("Give me a number"))
Also, since you are expecting a return value from your function, you should return a value. Currently, you are not returning anything from the function. Example -
while i<k:
...
i=i+1
print "The numbers are: " , numbers
return numbers
In Python 3.x , this type of comparison is not allowed, if you try to compare string and int with that operator, you would get an error like - TypeError: unorderable types: int() < str() .
y = int(raw_input("Give me a number"))and tell us how that goes :)