Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
165 views

A Python Book Beginning Python Advanced Python and Python Exercises-3

This document is a book about Python that covers topics ranging from basic syntax and data types to functions and classes. It is divided into sections covering the beginning of Python, lexical matters, built-in data types, functions and classes, and statements. The sections introduce Python concepts like numeric types, strings, dictionaries, files, functions, classes, and control flow statements.

Uploaded by

gjhgjgj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views

A Python Book Beginning Python Advanced Python and Python Exercises-3

This document is a book about Python that covers topics ranging from basic syntax and data types to functions and classes. It is divided into sections covering the beginning of Python, lexical matters, built-in data types, functions and classes, and statements. The sections introduce Python concepts like numeric types, strings, dictionaries, files, functions, classes, and control flow statements.

Uploaded by

gjhgjgj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Book

Contents
1   Part 1 ­­ Beginning Python...........................................................................................10
1.1   Introductions Etc...................................................................................................10
1.1.1   Resources.......................................................................................................11
1.1.2   A general description of Python....................................................................12
1.1.3   Interactive Python..........................................................................................15
1.2   Lexical matters......................................................................................................15
1.2.1   Lines..............................................................................................................15
1.2.2   Comments......................................................................................................16
1.2.3   Names and tokens..........................................................................................16
1.2.4   Blocks and indentation..................................................................................16
1.2.5   Doc strings.....................................................................................................17
1.2.6   Program structure..........................................................................................17
1.2.7   Operators.......................................................................................................18
1.2.8   Also see.........................................................................................................19
1.2.9   Code evaluation.............................................................................................19
1.3   Statements and inspection ­­ preliminaries...........................................................20
1.4   Built­in data­types.................................................................................................21
1.4.1   Numeric types................................................................................................21
1.4.2   Tuples and lists..............................................................................................21
1.4.3   Strings............................................................................................................24
1.4.3.1   The new string.format method...............................................................26
1.4.3.2   Unicode strings......................................................................................27
1.4.4   Dictionaries....................................................................................................29
1.4.5   Files...............................................................................................................32
1.4.6   Other built­in types........................................................................................35
1.4.6.1   The None value/type..............................................................................35
1.4.6.2   Boolean values.......................................................................................36
1.4.6.3   Sets and frozensets.................................................................................36
1.5   Functions and Classes ­­ A Preview......................................................................36
1.6   Statements.............................................................................................................37
1.6.1   Assignment statement....................................................................................37
1.6.2   import statement............................................................................................39
1.6.3   print statement...............................................................................................41
1.6.4   if: elif: else: statement...................................................................................43
1.6.5   for: statement.................................................................................................44
1.6.6   while: statement.............................................................................................48

Page 3

You might also like