Python Code for a Small Search Engine