And because the function is a trigonometric function, and it is constant in the interval with the interval length π!
So π is a period of this function!
Because the function is f(x)=sin(wx). So w=2π/π=2.