Create a function to seach a list of numbers for a given


In [5]:
lst = [5, 6, 78, 34, 4, 45, 23, 234]

In [8]:
def check_number(x):
    if x in lst:
        print(x, 'is in my list an the index is')
    else:
        print(x, 'is not in my list')


  File "<ipython-input-8-730aa7b927c1>", line 3
    print(x, 'is in my list an the index is', x[])
                                                ^
SyntaxError: invalid syntax

In [7]:
check_number(78)


78 is in my list

In [ ]:
#didn't get to the index part