If in a function I can return a print or the message itself that they ask me to give, the exercise says that if the number is inside the list it must tell the user that such a value is in the list and the same in case opposite.
def comprobarEnLista(L):
print"Ingrese el numero que desea saber si esta o no en la lista"
n=int(raw_input("Numero a comprobar: "))
L=[]
i=0
while i<len(L):
for cont in L:
if n==L[i]:
print "El valor %d esta en la lista"%n
else:
print"El valor %d no esta en la lista"%n
i+=1
That's the function that I'm creating, if you could help me, I'd appreciate it a lot