from __future__ import print_function

def sequential_search(a_list, item):
    """Sequential search."""
    pos = 0
    found_flag = False
    while pos < len(a_list) and not found_flag:
        if a_list[pos] == item:
            found_flag = True
        else:
            pos += 1
    return found_flag


def ordered_sequential_search(a_list, item):
    """Ordered sequential search."""
    pass


def main():
    a_list = [54, 26, 93, 17,77, 31, 44, 55, 20, 65]
    print('a_list: {}'.format(a_list))
    item = 65
    print('Search item {0}: {1}'
          .format(item, sequential_search(a_list, item)))
    item = 100
    print('Search item {0}: {1}'
          .format(item, sequential_search(a_list, item)))


if __name__ == '__main__':
    main()

@@ -392,26 +392,393 @@
     
-pass%0A%0A%0Adef main():
+a_list = sorted(a_list)%0A    pos = 0%0A    found_flag = False%0A    stop_flag = False%0A    while pos %3C len(a_list) and not found_flag and not stop_flag:%0A        if a_list%5Bpos%5D == item:%0A            found_flag = True%0A        else:%0A            if a_list%5Bpos%5D %3E item:%0A                stop_flag = True%0A            else:%0A                pos += 1%0A    return found_flag%0A%0A%0Adef main():%0A    import time
 %0A   
@@ -865,16 +865,46 @@
 a_list))
+%0A%0A    start_time = time.time()
 %0A    ite
@@ -1107,16 +1107,450 @@
 item)))%0A
+    print('Time for 2 sequential sorts: %7B%7D'%0A          .format(time.time() - start_time))%0A%0A    start_time = time.time()%0A    item = 65%0A    print('Search item %7B0%7D: %7B1%7D'%0A          .format(item, ordered_sequential_search(a_list, item)))%0A    item = 100%0A    print('Search item %7B0%7D: %7B1%7D'%0A          .format(item, ordered_sequential_search(a_list, item)))%0A    print('Time for 2 sequential sorts: %7B%7D'%0A          .format(time.time() - start_time))
 %0A%0Aif __n

Complete ordered_sequential_search()