print
is a function that doesn't return any value in Python. It only print its own arguments to the user on the screen.
Here is revised code:
def fun(x, y):
'''Takes an ordered list and another number as input'''
if y in x:
return "it's in the list"
else:
return "number is not in the list"
print(fun([2,3,4,5], 5))
For better readability, it is better to use "long" arguments after "short". Here is my more idiomatic version, just to build better habit:
def contains(item, sequence):
'''Check if item contains in sequence'''
if item in sequence:
return True
else:
return False
print(contains(5, [2,3,4,5]))