Python 2.5.2

Version of implementation CPython of programming language Python

Bugfix release: over 100 bugs and patches have been addressed since Python 2.5.1, many of them improving the stability of the interpreter, and improving its portability.

Examples:

Hello, World! - Python (52):

print "Hello, World!"

Factorial - Python (53):

This example uses recursive factorial definition.

#! /usr/bin/env python
def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)

for n in range(16 + 1):
    print n, "! = ", factorial(n)

Fibonacci numbers - Python (61):

This example uses recursive definition of Fibonacci numbers.

#! /usr/bin/env python
def fibonacci(n):
    if n < 3:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)

for n in range(1, 16 + 1):
    print "%i," % fibonacci(n) ,
print "..."