input_list = [4.0, 4.1, 4.2, 4.0, 9.0, 9.4, 8.9, 4.3]
results = {input_list[0]: [input_list[0]]}
for value in input_list[1:]:
    hi = value * 1.1
low = value * 0.9
print('Value: {0}\tHi: {1}\tLow:{2}'.format(value, hi, low))
for existing in results:
    found_similar = False
if low < existing < hi:
    results[existing].append(value)
found_similar = True
break
if not found_similar:
    results[value] = [value]
for entry in results:
    pass
In Python, how can I check if 2 numbers in a list are within a certain percentage of each other?