Search code examples
python-3.2pi

Pi Calculator In Python, is it fully functional?


I have created (with some help) this pi generator and wondered if it is fully functional and will continue to work without breaking. it runs in Python3.2

a, b = 0, 1
while 1:
    a = a + (4/b)
    b = b + 2

    a = a - (4/b)
    b = b + 2
    print(str(a))

Solution

  • Simply put, yes.

    Long answer, it will work for all versions of python 3.x