def linear_search(search_list, value_to_find): """ Uses a hand-coded linear search to find the position of an item in a list Parameters: the list; the item to search for Returns: the position of the item in the list (or None if it is not in the list) """ pass
Name of input file: cities.txt Number of lines in file: 50 0: Los Angeles 1: San Diego 2: San Jose 3: San Francisco [etc] Enter the name of a city: Santa Rosa The position of Santa Rosa is: Linear search: 25 Enter the name of a city: Oakland The position of Oakland is: Linear search: 7 Enter the name of a city: Cotati The position of Cotati is: Linear search: None Enter the name of a city: quit