print(np.sqrt(1 - 0.5**2))
This because in python your code is being interpreted in this order.
Firstly 0.5 is raised to 2 so this results in np.sqrt(1 - 0.25), then do a square root of 0.75 so we get 0.86. Which is why you are getting 0.86 and not 0.5.