Approximate the value of pi using Python