Python is a dynamically typed programming language with both imperative and functional features. Python source code is executed by the Python interpreter which internally compiles the code to bytecode for better performance.
Here is an example of the 100 doors problem:
#!/usr/bin/env python def doors (n): # Initialize an array doors = [False] * n # Process the doors for i in range(n): for j in range(i, n, i+1): doors[j] = not doors[j] # Print out the results for k, door in enumerate(doors): print "Door %d is" % (k+1), 'open.' if door else 'closed.' # Call the function doors with n = 100 doors(100)
Python has a very clean syntax and a well thought out design.
It is used in many different areas of software engineering such as web programming, scientific and numerical computing, and comes with a large standard library. There are many third party libraries available too.
Python is used by many large organizations in many successful projects.