22.07.2013 Views

A Comprehensive Introduction to Python Programming and ... - MSDL

A Comprehensive Introduction to Python Programming and ... - MSDL

A Comprehensive Introduction to Python Programming and ... - MSDL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1<br />

Overview of the <strong>Python</strong> Language<br />

1.1 Main Features<br />

<strong>Python</strong> is an interpreted, interactive, object-oriented high-level language. Its syntax<br />

resembles pseudo-code, especially because of the fact that indentation is used <strong>to</strong> indentify<br />

blocks. <strong>Python</strong> is a dynamcally typed language, <strong>and</strong> does not require variables<br />

<strong>to</strong> be declared before they are used. Variables “appear” when they are first used <strong>and</strong><br />

“disappear” when they are no longer needed.<br />

<strong>Python</strong> is a scripting language like Tcl <strong>and</strong> Perl. Because of its interpreted nature,<br />

it is also often compared <strong>to</strong> Java. Unlike Java, <strong>Python</strong> does not require all instructions<br />

<strong>to</strong> reside inside classes.<br />

<strong>Python</strong> is also a multi-platform language, since the <strong>Python</strong> interpreter is available<br />

for a large number of st<strong>and</strong>ard operating systems, including MacOS, UNIX, <strong>and</strong> Microsoft<br />

Windows. <strong>Python</strong> interpreters are usually written in C, <strong>and</strong> thus can be ported<br />

<strong>to</strong> almost any platform which has a C compiler.<br />

1.2 Language Features<br />

1.2.1 Literals<br />

1.2.1.1 Integers<br />

There are 3 kinds of integer literals:<br />

Decimal integers : integers not starting with a ’0’ digit or the integer 0 (eg: 205).<br />

Octal integers : integers which have a leading 0 as a prefix (eg: 0205).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!