Shell or File
Starting out, one quickly learns that there are two ways to program Python: in the Python shell or in a Python file. This section gives an overview of both. In the main, you will want to write your programs in a file using a text editor, but using the shell can be very helpful for trying out code.
One of the first things to learn when programming is that not all data is created equal. Various types of data fit best into different-sized containers. This section introduces the various data types used in Python programming.
Data by itself is not very useful. Like adding two and two, you need to be able to do something with data. That doing is commonly called data processing. Even the most fundamental data processing requires operators, signs and symbols that tell the computer what to do to and with data. Here we take a look at the most common Python operators and how to use them.
Part of data processing is being able to switch an operator on and off according to the conditions of the data. Here we look at forming conditions and loops and how to use ranges as a shortcut for long, predictable series.
Data types, operators, and flow control are just the beginning of Python programming. If you use them alone, you are liable to get a very unreadable program very quickly. Fortunately, Python has readability built into its syntax rules. Read this section to find out how.
Data types are just categories for kinds of data. Data structures, on the other hand, relate to how to create re-usable code. Re-usable code is easier to maintain and debug. Here is how to write functions and classes in Python.
In general, computer programs do not realise their full effectiveness until they can read or write outside themselves. Being able to import modules from the Python Library allows the programmer to use pre-written code safely and predictably. Being able to read and write files to the local disk or to a network server half-a-world away is essential for a modern program. If you do either, however, you must be able to handle errors and exceptions because your program will inevitably see aberrant data in the "wild."
Having worked through the preceding seven parts of Basic Python, you are ready to delve into more advanced material. This section contains links and references to several Python resources that can help you both online and off.