code: def Value(self, p):
          
          if p < 0 or p > 1:
              raise ValueError('Probability p must be in range [0, 1]')
  
          if p == 0: return self.xs[0]
          if p == 1: return self.xs[-1]
          index = bisect.bisect(self.ps, p)
          if p == self.ps[index - 1]:
              return self.xs[index - 1]
          else:
              return self.xs[index]
docs: Returns InverseCDF(p), the value that corresponds to probability p.
  
          Args:
              p: number in the range [0, 1]
  
          Returns:
              number value