Skip to main content

2014 | Buch

The Python Quick Syntax Reference

insite
SUCHEN

Über dieses Buch

The Python Quick Syntax Reference is the "go to" book that contains an easy to read and use guide to Python programming and development. This condensed code and syntax reference presents the Python language in a well-organized format designed to be used time and again.

You won't find jargon, bloated samples, case studies, or history of Hello World and computer theory in this handy reference. This Python syntax reference is packed with useful information and is a must-have for any Python developer.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Hello Python
Abstract
Let’s review a simple Python program that will explain the use of the Python Interactive Shell along with a few tips.
Gregory Walters
Chapter 2. Variables
Abstract
Variables are “slots” that we can store data in. Some languages, such as C#, Visual Basic, and others, require you to declare your variables before you use them along with the type of variable it is, for example, Integer or String. Python doesn't require you to do this. As I said in the Introduction, Python uses a scheme called “Duck Typing.” This means that you don't have to declare variables before they are used and that you don't have to specify what a type variable is or will be. There is a mix of opinions on this as to whether it is a good or bad thing.
Gregory Walters
Chapter 3. Operators
Abstract
Python supports several operators. Here, we review some of the key ones.
Gregory Walters
Chapter 4. Strings
Abstract
String objects exist in practically every programming language. A string is simply a series of characters assigned to a variable. Python strings are immutable, which means that once created, they can not be changed. String assignments look like this:
Gregory Walters
Chapter 5. Conditional Statements
Abstract
Conditional statements are an important part of many programs. They allow logic control of our programs. There are three main conditional statement types in Python. If / Elif / Else conditionals, For loops and While loops.
Gregory Walters
Chapter 6. Data Structures
Abstract
Data structures are important for most any serious (and some not so serious) programs. They allow us to store groups of related data under a single variable name and access them quickly and logically. There are many types of data structures available under Python and each will be explained in the following sections.
Gregory Walters
Chapter 7. Keywords
Abstract
Keywords are special reserved words that cannot be used as variable names. Keywords will change over time as Python versions change. Below is a short program that will allow you to obtain a list of keywords specific for your version of Python. It is written using Python 3.x syntax, but will work for version 2.7 as well.
Gregory Walters
Chapter 8. Functions
Abstract
We have already shown the functions that are built into Python. Although there is a wealth of functions available to us, there will be times that you need to create your own. In some other programming languages, functions are known as subroutines.
Gregory Walters
Chapter 9. Libraries
Abstract
There are a tremendous number of libraries that are available for Python, both that come with the standard installation and available from the web. In this chapter, I will try to give you a list of some of the more "generically" helpful ones. Most of this information was obtained from the official Python Docs page.
Gregory Walters
Chapter 10. Classes
Abstract
Classes are the way that we create objects. We use objects to try to model the real world in computer code. Objects are a way of encapsulating programming code that, not only can be reusable, but can be duplicated and modified without affecting the original object. Objects often have attributes and functions to modify those attributes. Classes also allow you to write a group of code that may be used in multiple projects without rewriting or copying the code into each project just like a library. We will concentrate on objects in this chapter, all though the concepts are the same for simple classes.
Gregory Walters
Backmatter
Metadaten
Titel
The Python Quick Syntax Reference
verfasst von
Gregory Walters
Copyright-Jahr
2014
Verlag
Apress
Electronic ISBN
978-1-4302-6479-8
Print ISBN
978-1-4302-6478-1
DOI
https://doi.org/10.1007/978-1-4302-6479-8