Hi
iam very beginner to python. my query is, i wrote user defined function(num()) to take input value (list item). if input value is not in the list item then again i want to ask input value (i.e. Again i want to call udf(inputnumber). While executing the code when i calling the function, code showing no error but executing nothing.
iam very beginner to python. my query is, i wrote user defined function(num()) to take input value (list item). if input value is not in the list item then again i want to ask input value (i.e. Again i want to call udf(inputnumber). While executing the code when i calling the function, code showing no error but executing nothing.
def num():
n = int(input("Enter a list item: "))
num()
a=[56,34,29,39]
if n in a :
print("Given number index in the list is : ", a.index(n))
else:
print("input value is not in the list item")
num()Ex: if input value is 30 then code should call function(num) and again ask input value till input value in the list.
