From the man page:
-i When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command. It does not read the $PYTHONSTARTUP file. This can be useful to inspect global variables or a stack trace when a script raises an exception.
I tested your code as follows and it worked for me:
python3 -i python_test.py
>>> my_first([3, 2, 1])
3
>>> my_contains(2, [1, 10, 100])
False
>>> my_contains(1, [2, 1, 3])
True
This answer is copied almost verbatim from https://stackoverflow.com/a/5280210/7554621
As for IPython, it seems that it cannot find the module which means it has not been installed, was installed incorrectly, doesn't know where to find it, the name is incorrect, or its being used incorrectly. I looked into installing it here http://ipython.readthedocs.io/en/stable/install/index.html.
After installing it, I simply used ipython instead of python3 to load the file and enter an interactive shell:
@WillemVanOnsem made a good point in the comments above that pip3 may need to be used instead of pip. For me, pip worked fine and installed correctly.
pip install ipython
ipython -i python_test.py
Python 3.5.1 (default, Apr 18 2016, 11:46:32)
In [1]: my_contains(1, [1, 2, 3])
Out[1]: True
In [2]: my_first([1, 2, 3])
Out[2]: 1