@@ -0,0 +1,1017 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%22%22%22%0Abringing all parts of the code together in a small example%0A%22%22%22%0A%0Atrial_lst = %5B0.5, 3, 6, 40, 90, 130.8, 129, 111, 8, 9, 0.01, 9, 40, 90, 130.1, 112,%0A             108, 90, 77, 68, 0.9, 8, 40, 90, 92, 130.4%5D%0A%0Atrial_lst.sort(key=float)%0A%0Atotals = %5B%5D%0Afor count, items in enumerate(trial_lst):%0A%0A    counter = count + 1%0A    last_object = (trial_lst%5Bcount%5D, trial_lst%5B(len(trial_lst)-1) - count%5D)%0A    totals.append(last_object)%0A%0Atotals = totals%5B:3%5D%0A%0Adata_ = %5B0.5, 3, 6, 40, 90, 130.8, 129, 111, 8, 9, 0.01, 9, 40, 90, 130.1, 112,%0A             108, 90, 77, 68, 0.9, 8, 40, 90, 92, 130.4%5D%0A%0Acombine_data = %5B%5D%0Afor i in range(len(data_)):%0A    flag = 0%0A    for j in totals:%0A        if data_%5Bi%5D == j%5B0%5D:%0A            combine_data.append((data_%5Bi%5D, %22min%22))%0A            flag = 1%0A        if data_%5Bi%5D == j%5B1%5D:%0A            combine_data.append((data_%5Bi%5D, %22max%22))%0A            flag = 1%0A    if(flag == 0):%0A        combine_data.append((data_%5Bi%5D,)) %0A           %0Aprint(combine_data)%0A            

fix duplicate issue using flag variable