aboutsummaryrefslogtreecommitdiff
path: root/challenge-098/laurent-rosenfeld/python/ch-2.py
blob: e1ab38f80808244de11b36e69d892e35842694be (plain)
1
2
3
4
5
6
7
8
9
def find_insert_pos(target, list):
    for i in range(len(list)):
        if list[i] >= target:
            return i
    return len(list)

in_list = [1, 3, 5, 7]
for j in range (8):
    print('Target: ', j, '->', find_insert_pos(j, in_list))