Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Python 101 - Introduction to Python

By Dave Kuhlman
2005-07-02


Python 101 -- Introduction to Python

Python is a high-level general purpose programming language. Because code is automatically compiled to byte code and executed, Python is suitable for use as a scripting language, Web application implementation language, etc. Because Python can be extended in C and C++, Python can provide the speed needed for even compute intensive tasks.

Important Features of Python

  • Built-in high level data types: strings, lists, dictionaries, etc.

  • The usual control structures: if, if-else, if-elif-else, while, plus a powerful collection iterator (for).

  • Multiple levels of organizational structure: functions, classes, modules, and packages. These assist in organizing code. An excellent and large example is the Python standard library.

  • Compile on the fly to byte code -- Source code is compiled to byte code without a separate compile step. Source code modules can also be "pre-compiled" to byte code files.

  • Extensions in C and C++ -- Extension modules and extension types can be written by hand. There are also tools that help with this, for example, SWIG, sip, Pyrex.

Some things you will need to know:

  • Python uses indentation to show block structure. Indent one level to show the beginning of a block. Out-dent one level to show the end of a block. As an example, the following C-style code:

    if (x)
    
    {
    if (y)
    {
    f1()
    }
    f2()
    }

    in Python would be:

    if x:
    
    if y:
    f1()
    f2()

    And, the convention is to use four spaces (and no tabs) for each level of indentation.

Where to Go For Additional help



Tutorial Pages:
» Python 101 -- Introduction to Python
» Interactive Python
» Data Types
» Simple Statements
» Control Structures
» Organization


Copyright (c) 2003 Dave Kuhlman


 | Bookmark
Related Tutorials:
» Python and Java - A Side by Side Comparison
» Learn Python in 10 Minutes
» Python 201 - (Slightly) Advanced Python Topics
» Google Sitemaps
» Python 101
» Python vs. Perl

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources