7dff214d9ba2bd178830d06422073022def49ba3,BinarySeach.py,,,#,25

Before Change


            // print("Not found")
    return found
print("Enter numbers seprated by space")
s = input()
numbers = list(map(int, s.split()))
trgt =int( input("enter a single number to be found in the list "))
binarySearch(numbers, trgt)

After Change


    return None


if __name__ == "__main__":
    import sys
    // For python 2.x and 3.x compatibility: 3.x has not raw_input builtin
    // otherwise 2.x"s input builtin function is too "smart"
    if sys.version_info.major < 3:
        input_function = raw_input
    else:
        input_function = input

    user_input = input_function("Enter numbers separated by coma:\n")
    collection = [int(item) for item in user_input.split(",")]

    target_input = input_function(
        "Enter a single number to be found in the list:\n"
    )
    target = int(target_input)
    result = binary_search(collection, target)
    if result is not None:
        print("{} found at positions: {}".format(target, result))
    else:
        print("Not found")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: TheAlgorithms/Python
Commit Name: 7dff214d9ba2bd178830d06422073022def49ba3
Time: 2016-07-29
Author: me@sergeytsaplin.com
File Name: BinarySeach.py
Class Name:
Method Name:


Project Name: TheAlgorithms/Python
Commit Name: b7eae6b0e37c0b44889657688a530f307c8cd2f5
Time: 2016-07-29
Author: tony@motiondsp.com
File Name: LinearSearch.py
Class Name:
Method Name:


Project Name: TheAlgorithms/Python
Commit Name: 578845a6b5491c797ddad8eb61297e9f6383962c
Time: 2016-07-29
Author: tony@motiondsp.com
File Name: MergeSort.py
Class Name:
Method Name: