To find the standard deviation of a population we do not need to use Bessel’s correction, and your function will work (assuming we import numpy as np first). However, in the second bullet point of the instructions they ask us to make our function flexible enough to work for populations OR samples. To calculate the standard deviation for a sample we DO need to use Bessel’s correction, and since there is no way for a function to “detect” if the array is a sample or population, they are implicitly asking for our function to take in a third argument, is the array a sample or population? The DQ answer used a Boolian value, making the input optional with a default value, but its your function, so feel free to use an argument that makes sense to you.
I found the instructions for this step a little misleading, since it seems like they are asking for a function that takes in two arguments, but then later add criteria that necessitates a third argument. I’m commenting here because it seems this was unclear to the OP as well, and hopefully this can help out someone else down the line.
(side note, I get a little frustrated by the way that DQ frequently presents these practice problems in an almost intentionally garbled manner, or will ask us to use some technique or method that we have never seen before. But the justification I have read here in the comments is that in the real world most projects are presented to data scientists in an unclear way and/or will require a method or skill they aren’t familiar with, so we need to learn how to operate under those conditions. What do you think?)
-edited for clarity