Skip to content

Instantly share code, notes, and snippets.

View captainlepton's full-sized avatar

Captain Lepton captainlepton

  • London
View GitHub Profile
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
from hypothesis import given, example
import hypothesis.strategies as st
def linear_search(key, l):
"""Given a search key and a list of tuples (key, value), return
the first item that matches the key, or None if none match.
Example: