I have a task from which I would like to find the confidence level given the z value. I have a sample population. From that population, given its distribution, I would like to find the confidence level of a given value of that population. In other words, given a a value of the population, I would like to know if it is within 95% (confidence level) of the whole population or 68% or 50% and so on. Usually, we can find the z value and confidence interval and given confidence level as explained here How to find the confidence Interval. But I would like to find the confidence level given the z value (which in this case is a given value from the population).
How can I tackle this? If possible it should be in python or in R