The Python InterpreterThe BasicsLanguage SemanticsIndentation, not bracesEverything is an objectCommentsFunction and object method callsVariables and pass-by-referenceDynamic references, strong typesAttributes and methods“Duck” typingImportsBinary operators and comparisonsStrictness versus lazinessMutable and immutable objectsScalar TypesNumeric typesStringsBooleansType castingNoneDates and timesControl Flowif, elif, and elsefor loopswhile loopspassException handlingrange and xrangeTernary ExpressionsData Structures and SequencesTupleUnpacking tuplesTuple methodsListAdding and removing elementsConcatenating and combining listsSortingBinary search and maintaining a sorted listSlicingBuilt-in Sequence FunctionsenumeratesortedzipreversedDictCreating dicts from sequencesDefault valuesValid dict key typesSetList, Set, and Dict ComprehensionsNested list comprehensionsFunctionsNamespaces, Scope, and Local FunctionsReturning Multiple ValuesFunctions Are ObjectsAnonymous (lambda) FunctionsClosures: Functions that Return FunctionsExtended Call Syntax with *args, **kwargsCurrying: Partial Argument ApplicationGeneratorsGenerator expresssionsitertools moduleFiles and the operating system