Chapter 1. Python Shortcuts


    Section 1.1.  Introduction

    Section 1.2.  Swapping Values WithoutUsing a Temporary Variable

    Section 1.3.  Constructing a Dictionary Without Excessive Quoting

    Section 1.4.  Getting a Value from a Dictionary

    Section 1.5.  Adding an Entry to a Dictionary

    Section 1.6.  Associating Multiple Values with Each Key in a Dictionary

    Section 1.7.  Dispatching Using a Dictionary

    Section 1.8.  Collecting a Bunch of Named Items

    Section 1.9.  Finding the Intersection of Two Dictionaries

    Section 1.10.  Assigning and Testing with One Statement

    Section 1.11.  Using List Comprehensions Instead of map and filter

    Section 1.12.  Unzipping Simple List-Like Objects

    Section 1.13.  Flattening a Nested Sequence

    Section 1.14.  Looping in Parallel over Index and Sequence Items

    Section 1.15.  Looping Through Multiple Lists

    Section 1.16.  Spanning a Range Defined by Floats

    Section 1.17.  Transposing Two-Dimensional Arrays

    Section 1.18.  Creating Lists of Lists Without Sharing References



Python Cookbook
Python Cookbook
ISBN: 0596007973
EAN: 2147483647
Year: 2005
Pages: 346

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net