Skip to content

Instantly share code, notes, and snippets.

@rogfrich
rogfrich / Ex20.py
Last active April 20, 2019 10:47
Solution for Ex20 on www.practicepython.org
"""
Write a function that takes an ordered list of numbers (a list where the elements are in order from smallest to
largest) and another number. The function decides whether or not the given number is inside the list and returns
(then prints) an appropriate boolean.
Extras: Use binary search.
NOTE: I created an option to compare the time taken by three different search methods.
"""
import random, time, sys