Hill climbing search code in python