See All Titles |
![]() ![]() SummaryPython is a language that doesn't ask too much from programmers while they are learning it. A programmer can code almost anything using a minimum amount of code. Python provides a command-line interpreter, which is the interface to its shell environment. Python programs can be typed and executed directly in the interpreter or stored and called from files. No matter where the programmer is entering the code, indentation is vital. It is extremely critical that all code blocks follow the indentation rules defined by the language. Python does object reference counting in order to keep you away from the job of deallocating variables by doing its own memory management. The language has two groups of built-in data types that already exist in the interpreter: the immutable data types (for example, strings, numbers, and tuples) and the mutable data types (for example, lists and dictionaries). Python also provides a number of built-in functions that are always available when you load the interpreter. Besides that, it enables you to define and use your own group of functions, which are called user-defined functions. Apart from that, Python also implements procedural abstraction using the function lambda. The basics control statements if, for, and while are provided by Python too. They all have predictable behavior. However, the statements for and while also implement the else structure. Python defines three types of dynamic namespace: built-in names, global names, and local names. This feature allows you to encapsulate your objects within distinct scopes. You can use modules and packages (collections of modules) to store your programs. Both are well supported by Python. All the regular features that provide input and output operations are currently supported by Python. Along with that, Python's core language supports all the basic functions necessary to manipulate files.
|
© 2002, O'Reilly & Associates, Inc. |