@@ -9,15 +9,184 @@ by **Ankit Mahato**
9
9
10
10
This book can be consumed in 3 ways:
11
11
12
- ## A nice web interface
13
- [ Link] ( )
12
+ - A nice web interface - [ Link] ( https://animator.github.io/learn-python/ )
13
+ - A Downloadable PDF - [ Link] ( )
14
+ - Directly on GitHub - [ Link] ( https://github.com/animator/learn-python )
14
15
15
- ## A Downloadable PDF
16
- [ Link] ( )
17
16
18
- ## Directly on GitHub
19
- [ Link ] ( )
17
+ Table of Contents
18
+ =================
20
19
20
+ * [ Introduction] ( #introduction )
21
+ * [ Introduction to Programming Languages] ( #introduction-to-programming-languages )
22
+ * [ Introduction to Python] ( #introduction-to-python )
23
+ * [ Advantages of Python] ( #advantages-of-python )
24
+ * [ Installing Python in Windows] ( #installing-python-in-windows )
25
+ * [ Installing Python in macOS (Apple)] ( #installing-python-in-macos-apple )
26
+ * [ Execution Modes] ( #execution-modes )
27
+ * [ Interactive Mode of Execution] ( #interactive-mode-of-execution )
28
+ * [ Script Mode of Execution] ( #script-mode-of-execution )
29
+ * [ Python Fundamentals] ( #python-fundamentals )
30
+ * [ Tokens: Introduction] ( #tokens-introduction )
31
+ * [ Tokens: Keywords] ( #tokens-keywords )
32
+ * [ Tokens: Identifiers] ( #tokens-identifiers )
33
+ * [ Tokens: Literals] ( #tokens-literals )
34
+ * [ Tokens: Operators] ( #tokens-operators )
35
+ * [ Tokens: Delimiters] ( #tokens-delimiters )
36
+ * [ Character Set] ( #character-set )
37
+ * [ Blocks and Indentation] ( #blocks-and-indentation )
38
+ * [ Comments] ( #comments )
39
+ * [ Variables, Objects & ; Data Types] ( #variables-objects--data-types )
40
+ * [ What are Objects & ; Variables?] ( #what-are-objects--variables )
41
+ * [ Variables & ; Assignment Statements] ( #variables--assignment-statements )
42
+ * [ Built-in Data Types] ( #built-in-data-types )
43
+ * [ Type Checking] ( #type-checking )
44
+ * [ Type Casting] ( #type-casting )
45
+ * [ Implicit Type Casting] ( #implicit-type-casting )
46
+ * [ Explicit Type Casting] ( #explicit-type-casting )
47
+ * [ Mutable & ; Immutable Data Types] ( #mutable--immutable-data-types )
48
+ * [ Immutable Data Types] ( #immutable-data-types )
49
+ * [ Mutable Data Types] ( #mutable-data-types )
50
+ * [ Input / Output] ( #input--output )
51
+ * [ How to Accept User Input] ( #how-to-accept-user-input )
52
+ * [ Displaying Output] ( #displaying-output )
53
+ * [ Operators & ; Expressions] ( #operators--expressions )
54
+ * [ Introduction to Operators] ( #introduction-to-operators )
55
+ * [ Arithmetic Operators] ( #arithmetic-operators )
56
+ * [ Relational Operators] ( #relational-operators )
57
+ * [ Assignment Operators] ( #assignment-operators )
58
+ * [ Logical Operators] ( #logical-operators )
59
+ * [ Identity Operators] ( #identity-operators )
60
+ * [ Membership Operators] ( #membership-operators )
61
+ * [ Expressions] ( #expressions )
62
+ * [ Operator Precedence with Examples] ( #operator-precedence-with-examples )
63
+ * [ Errors & ; Exception Handling] ( #errors--exception-handling )
64
+ * [ Error Types] ( #error-types )
65
+ * [ Syntax Error] ( #syntax-error )
66
+ * [ Runtime Error] ( #runtime-error )
67
+ * [ Logical Error] ( #logical-error )
68
+ * [ Exceptions] ( #exceptions )
69
+ * [ Exception Handling] ( #exception-handling )
70
+ * [ Control Flow] ( #control-flow )
71
+ * [ Introduction to Control Flow] ( #introduction-to-control-flow )
72
+ * [ Sequential Flow] ( #sequential-flow )
73
+ * [ Selection Statements: if .. else] ( #selection-statements-if--else )
74
+ * [ Iteration: for] ( #iteration-for )
75
+ * [ Iteration: while] ( #iteration-while )
76
+ * [ Jump Statements] ( #jump-statements )
77
+ * [ pass] ( #pass )
78
+ * [ break] ( #break )
79
+ * [ continue] ( #continue )
80
+ * [ Nested Loops] ( #nested-loops )
81
+ * [ Strings] ( #strings )
82
+ * [ Strings: Introduction & ; Creation] ( #strings-introduction--creation )
83
+ * [ Accessing Characters of a String] ( #accessing-characters-of-a-string )
84
+ * [ String Operations] ( #string-operations )
85
+ * [ Introduction to String Methods] ( #introduction-to-string-methods )
86
+ * [ Convert Case of Strings] ( #convert-case-of-strings )
87
+ * [ Check Characters of a String] ( #check-characters-of-a-string )
88
+ * [ Split a String] ( #split-a-string )
89
+ * [ Strip Characters from a String] ( #strip-characters-from-a-string )
90
+ * [ Check Prefix or Suffix in a String] ( #check-prefix-or-suffix-in-a-string )
91
+ * [ Find & ; Replace Characters in a String] ( #find--replace-characters-in-a-string )
92
+ * [ Traversing a String] ( #traversing-a-string )
93
+ * [ List] ( #list )
94
+ * [ What is a Python List? How to Create a List?] ( #what-is-a-python-list-how-to-create-a-list )
95
+ * [ Accessing Items of a List] ( #accessing-items-of-a-list )
96
+ * [ Negative Indexing] ( #negative-indexing )
97
+ * [ Modifying a List] ( #modifying-a-list )
98
+ * [ Removing Item from a List] ( #removing-item-from-a-list )
99
+ * [ List Operations] ( #list-operations )
100
+ * [ Traversing a List] ( #traversing-a-list )
101
+ * [ Built-in Functions that can be used for a List] ( #built-in-functions-that-can-be-used-for-a-list )
102
+ * [ Introduction to List Methods] ( #introduction-to-list-methods )
103
+ * [ Adding Items to a List] ( #adding-items-to-a-list )
104
+ * [ Removing Items from a List] ( #removing-items-from-a-list )
105
+ * [ Counting or Locating Items in a List] ( #counting-or-locating-items-in-a-list )
106
+ * [ Reversing Items] ( #reversing-items )
107
+ * [ Sorting a List] ( #sorting-a-list )
108
+ * [ Copying a List] ( #copying-a-list )
109
+ * [ Nested List] ( #nested-list )
110
+ * [ List Comprehension] ( #list-comprehension )
111
+ * [ Member-wise Operation] ( #member-wise-operation )
112
+ * [ Filtering or Subsequence] ( #filtering-or-subsequence )
113
+ * [ Sample Programs] ( #sample-programs )
114
+ * [ Tuple] ( #tuple )
115
+ * [ List vs Tuple] ( #list-vs-tuple )
116
+ * [ How to Create Tuple?] ( #how-to-create-tuple )
117
+ * [ What is a Singleton?] ( #what-is-a-singleton )
118
+ * [ Accessing Items of a Tuple] ( #accessing-items-of-a-tuple )
119
+ * [ Tuples are Immutable] ( #tuples-are-immutable )
120
+ * [ Tuple Operations] ( #tuple-operations )
121
+ * [ Traversing a Tuple] ( #traversing-a-tuple )
122
+ * [ Built-in Functions that can be used for a Tuple] ( #built-in-functions-that-can-be-used-for-a-tuple )
123
+ * [ Locating Items in a Tuple] ( #locating-items-in-a-tuple )
124
+ * [ Counting the Occurrence of an Item] ( #counting-the-occurrence-of-an-item )
125
+ * [ New Tuple with Reversed Items] ( #new-tuple-with-reversed-items )
126
+ * [ New Tuple with Sorted Items] ( #new-tuple-with-sorted-items )
127
+ * [ Nested Tuple] ( #nested-tuple )
128
+ * [ Understanding the Immutable Nature of Tuples] ( #understanding-the-immutable-nature-of-tuples )
129
+ * [ Dictionary] ( #dictionary )
130
+ * [ What is a Dictionary?] ( #what-is-a-dictionary )
131
+ * [ How to Create a Dictionary] ( #how-to-create-a-dictionary )
132
+ * [ Key: Value Pairs] ( #key-value-pairs )
133
+ * [ Sequence of (key, value) Tuples] ( #sequence-of-key-value-tuples )
134
+ * [ Keyword/Named Arguments] ( #keywordnamed-arguments )
135
+ * [ Key and Value Lists] ( #key-and-value-lists )
136
+ * [ Keys with Default Value] ( #keys-with-default-value )
137
+ * [ Accessing Items (Key: Value ) of a Dictionary] ( #accessing-items-keyvalue-of-a-dictionary )
138
+ * [ Updating a Dictionary] ( #updating-a-dictionary )
139
+ * [ Removing an Item (Key: Value ) from a Dictionary] ( #removing-an-item-keyvalue-from-a-dictionary )
140
+ * [ Dictionary Operations] ( #dictionary-operations )
141
+ * [ Traversing a Dictionary] ( #traversing-a-dictionary )
142
+ * [ Built-in Functions for a Dictionary] ( #built-in-functions-for-a-dictionary )
143
+ * [ Creating a Copy of a Dictionary] ( #creating-a-copy-of-a-dictionary )
144
+ * [ Nested Dictionary] ( #nested-dictionary )
145
+ * [ Sample Programs] ( #sample-programs-1 )
146
+ * [ Python Standard Library] ( #python-standard-library )
147
+ * [ Built-in Functions] ( #built-in-functions )
148
+ * [ Mathematical Functions] ( #mathematical-functions )
149
+ * [ Type Functions] ( #type-functions )
150
+ * [ Type Checking] ( #type-checking-1 )
151
+ * [ Built-in Type Functions] ( #built-in-type-functions )
152
+ * [ I/O Functions] ( #io-functions )
153
+ * [ Base/Unicode Conversion Functions] ( #baseunicode-conversion-functions )
154
+ * [ What are Built-in Modules?] ( #what-are-built-in-modules )
155
+ * [ math Module] ( #math-module )
156
+ * [ Constants] ( #constants )
157
+ * [ Functions] ( #functions )
158
+ * [ random Module] ( #random-module )
159
+ * [ statistics Module] ( #statistics-module )
160
+ * [ File Handling] ( #file-handling )
161
+ * [ File Handling in Python - Introduction & ; Overview] ( #file-handling-in-python---introduction--overview )
162
+ * [ Text Files vs Binary Files - Use Case, File Formats, Examples] ( #text-files-vs-binary-files---use-case-file-formats-examples )
163
+ * [ File Opening & ; Closing] ( #file-opening--closing )
164
+ * [ File Reading] ( #file-reading )
165
+ * [ Sequential Reading] ( #sequential-reading )
166
+ * [ Ad-hoc Reading] ( #ad-hoc-reading )
167
+ * [ Writing a File] ( #writing-a-file )
168
+ * [ Reading & ; Writing Binary Files using pickle Module] ( #reading--writing-binary-files-using-pickle-module )
169
+ * [ Dumping Data] ( #dumping-data )
170
+ * [ Loading Data] ( #loading-data )
171
+ * [ Example: Traversing a Binary File] ( #example-traversing-a-binary-file )
172
+ * [ Reading & ; Writing a CSV File using csv Module] ( #reading--writing-a-csv-file-using-csv-module )
173
+ * [ Reading CSV File] ( #reading-csv-file )
174
+ * [ Writing CSV File] ( #writing-csv-file )
175
+ * [ User Defined Functions, Modules & ; Packages] ( #user-defined-functions-modules--packages )
176
+ * [ User Defined Functions] ( #user-defined-functions )
177
+ * [ Function Structure] ( #function-structure )
178
+ * [ Function Header] ( #function-header )
179
+ * [ Function Body] ( #function-body )
180
+ * [ Parameters and Arguments] ( #parameters-and-arguments )
181
+ * [ Scope of Variables] ( #scope-of-variables )
182
+ * [ Local Variables] ( #local-variables )
183
+ * [ Global Variables] ( #global-variables )
184
+ * [ Passing Objects of Mutable Type to a Function] ( #passing-objects-of-mutable-type-to-a-function )
185
+ * [ Passing a List] ( #passing-a-list )
186
+ * [ Passing a Dictionary] ( #passing-a-dictionary )
187
+ * [ What is a Module? How to Create a Module?] ( #what-is-a-module-how-to-create-a-module )
188
+ * [ Executable Scripts / Modules] ( #executable-scripts--modules )
189
+ * [ What is a Package? Introduction to PyPi. How to Create a Python Package?] ( #what-is-a-package-introduction-to-pypi-how-to-create-a-python-package )
21
190
22
191
# Introduction
23
192
@@ -584,7 +753,7 @@ sum_6 = (1 + 2 + 3 + 4 + 5 + 6)
584
753
585
754
Tokens in Python which are used for punctuation, decoration and annotation are:
586
755
587
- ``` python
756
+ ```
588
757
. , :
589
758
; @ ->
590
759
```
@@ -593,7 +762,7 @@ Tokens in Python which are used for punctuation, decoration and annotation are:
593
762
594
763
The assignment or binding delimiters are used for binding objects to names via assignment statements. The complete list of tokens are provided below:
595
764
596
- ``` python
765
+ ```
597
766
= += -= *=
598
767
/= //= %= **=
599
768
@= &= |= ^=
0 commit comments