code: def percentile(self, lst_data, percent , key=lambda x:x):
          
          new_list = sorted(lst_data)
          #print('new list = ' , new_list)
          #n = float(len(lst_data))
          k = (len(new_list)-1) * percent
          f = math.floor(k)
          c = math.ceil(k)
          if f == c:
              #print(key(new_list[int(k)]))
              return key(new_list[int(k)])
          d0 = float(key(new_list[int(f)])) * (c-k)
          d1 = float(key(new_list[int(c)])) * (k-f)
          return d0+d1
docs: calculates the 'num' percentile of the items in the list