Skip to content

Commit 2ff95ea

Browse files
committed
Added ToC in PyBasics-1.ipynb
1 parent 50aaa31 commit 2ff95ea

File tree

3 files changed

+58
-18
lines changed

3 files changed

+58
-18
lines changed

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,18 @@ This repo contains different code snippets from basic to advanced python concept
33

44
**Python concepts' summary with example code snippets.**
55

6+
# Basic (Ongoing)
7+
8+
This folder contains basic level code structures.
9+
10+
1. [PyBasics-1.ipynb](basic/PyBasics-1.ipynb) \
11+
The notebook contains info about: Python 35 Keywords, Python Identifiers(Variables, Constants, Literals), Python Data Types, Type Casting, Python Operators, Python Namespace and Variable Scope.
12+
13+
# Intermediate (Upcoming)
14+
15+
This folder contains intermediate level code structures.
16+
617
1. [Generators](intermediate/Generators.ipynb)
7-
2. [Decorators](intermediate/Decorators.ipynb)
18+
2. [Decorators](intermediate/Decorators.ipynb)
19+
20+
# Advanced (Upcoming)

basic/PyBasics-1.ipynb

+44-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,35 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Python Keywords\n",
7+
"**Table of contents**<a id='toc0_'></a> \n",
8+
"- [Python Keywords](#toc1_) \n",
9+
" - [Python 35 Keywords](#toc1_1_) \n",
10+
"- [Python Identifiers](#toc2_) \n",
11+
" - [Variables](#toc2_1_) \n",
12+
" - [Constants](#toc2_2_) \n",
13+
" - [Literals](#toc2_3_) \n",
14+
"- [Python Data Types](#toc3_) \n",
15+
"- [Python Type Conversion (Type Casting)](#toc4_) \n",
16+
"- [Python Operators](#toc5_) \n",
17+
"- [Python Namespace and Scope](#toc6_) \n",
18+
" - [Python Variable Scope << Namespaces >>](#toc6_1_) \n",
19+
"- [References](#toc7_) \n",
20+
"\n",
21+
"<!-- vscode-jupyter-toc-config\n",
22+
"\tnumbering=false\n",
23+
"\tanchor=true\n",
24+
"\tflat=false\n",
25+
"\tminLevel=1\n",
26+
"\tmaxLevel=6\n",
27+
"\t/vscode-jupyter-toc-config -->\n",
28+
"<!-- THIS CELL WILL BE REPLACED ON TOC UPDATE. DO NOT WRITE YOUR TEXT IN THIS CELL -->"
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {},
34+
"source": [
35+
"# <a id='toc1_'></a>[Python Keywords](#toc0_)\n",
836
"- Keywords are predefined, reserved words \n",
937
"- Cannot use a keyword as a variable name, function name\n",
1038
"- used to define the syntax and structure of the Python language\n",
@@ -16,7 +44,7 @@
1644
"cell_type": "markdown",
1745
"metadata": {},
1846
"source": [
19-
"## Python 35 Keywords\n",
47+
"## <a id='toc1_1_'></a>[Python 35 Keywords](#toc0_)\n",
2048
"\n",
2149
"`import` `from` `as` \n",
2250
"\n",
@@ -71,15 +99,15 @@
7199
"cell_type": "markdown",
72100
"metadata": {},
73101
"source": [
74-
"# Python Identifiers\n",
102+
"# <a id='toc2_'></a>[Python Identifiers](#toc0_)\n",
75103
"\n",
76104
"Identifiers are the name given to variables, classes, methods, etc.\n",
77105
"\n",
78106
"`language = 'Python'`\n",
79107
"Here, language is a variable (an identifier) which holds the value 'Python'\n",
80108
"\n",
81109
"\n",
82-
"## Variables\n",
110+
"## <a id='toc2_1_'></a>[Variables](#toc0_)\n",
83111
"A `variable` is a container (storage area) to hold data. Exp: `number = 10`\n",
84112
"\n",
85113
"**Variable Naming Conventions**\n",
@@ -94,22 +122,21 @@
94122
"2. Class names should normally use the CapWords convention. Exp: class BankAccount:\n",
95123
"3. Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.\n",
96124
"4. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.\n",
97-
"Function names should be lowercase, with words separated by underscores as necessary to improve readability. Exp: def withdrawal(): or def bank_withdrawal():\n",
98-
"\n",
99-
"5. Variable names follow the same convention as function names.\n",
125+
"5. Function names should be lowercase, with words separated by underscores as necessary to improve readability. Exp: def withdrawal(): or def bank_withdrawal():\n",
126+
"6. Variable names follow the same convention as function names.\n",
100127
"```\n",
101128
"a=[1,2,3]\n",
102129
"d={‘a’:1}\n",
103130
"colors=[‘red’,’blue’]\n",
104131
"```\n",
105-
"6. Method names and also instance variables should be lowercase with words separated by underscores as necessary to improve readability.\n",
106-
"7. Use one leading underscore only for non-public methods and instance variables.\n",
132+
"7. Method names and also instance variables should be lowercase with words separated by underscores as necessary to improve readability.\n",
133+
"8. Use one leading underscore only for non-public methods and instance variables.\n",
107134
"\n",
108135
"\n",
109-
"## Constants\n",
136+
"## <a id='toc2_2_'></a>[Constants](#toc0_)\n",
110137
"A `constant` is a special type of variable whose value cannot (is not) be changed. Exp: PI = 3.14\n",
111138
"\n",
112-
"## Literals\n",
139+
"## <a id='toc2_3_'></a>[Literals](#toc0_)\n",
113140
"`Literals` are representations of fixed values in a program. \\\n",
114141
"They can be numbers, characters, or strings, etc. For example, 'Hello, World!', 12, 23.0, 'C', etc.\n",
115142
"\n",
@@ -127,7 +154,7 @@
127154
"cell_type": "markdown",
128155
"metadata": {},
129156
"source": [
130-
"# Python Data Types\n",
157+
"# <a id='toc3_'></a>[Python Data Types](#toc0_)\n",
131158
"\n",
132159
"\n",
133160
"![Python Data Types](imgs/python_data_types.PNG)\n",
@@ -183,7 +210,7 @@
183210
"cell_type": "markdown",
184211
"metadata": {},
185212
"source": [
186-
"# Python Type Conversion (Type Casting)\n",
213+
"# <a id='toc4_'></a>[Python Type Conversion (Type Casting)](#toc0_)\n",
187214
"Type conversion is the process of converting data of one type to another\n",
188215
"\n",
189216
"**Type conversion in Python**\n",
@@ -259,7 +286,7 @@
259286
"cell_type": "markdown",
260287
"metadata": {},
261288
"source": [
262-
"# Python Operators\n",
289+
"# <a id='toc5_'></a>[Python Operators](#toc0_)\n",
263290
"Operators are special symbols that perform operations on variables and values.\n",
264291
"\n",
265292
"**Types of Python Operators**\n",
@@ -369,7 +396,7 @@
369396
"cell_type": "markdown",
370397
"metadata": {},
371398
"source": [
372-
"# Python Namespace and Scope\n",
399+
"# <a id='toc6_'></a>[Python Namespace and Scope](#toc0_)\n",
373400
"\n",
374401
"- `Namespace` is a mapping of every name used to store the values of variables and other objects in the program, and to associate them with a specific name\n",
375402
"- This allows us to use the same name for different variables or objects in different parts of your code, without causing any conflicts or confusion.\n",
@@ -392,7 +419,7 @@
392419
"- A local namespace is created when a function is called, which has all the names defined in it.\n",
393420
"- Similar is the case with class.\n",
394421
"\n",
395-
"## Python Variable Scope << Namespaces >>\n",
422+
"## <a id='toc6_1_'></a>[Python Variable Scope << Namespaces >>](#toc0_)\n",
396423
"**When a reference is made inside a function, the name is searched in the local namespace, then in the global namespace and finally in the built-in namespace.**"
397424
]
398425
},
@@ -440,7 +467,7 @@
440467
"cell_type": "markdown",
441468
"metadata": {},
442469
"source": [
443-
"# References\n",
470+
"# <a id='toc7_'></a>[References](#toc0_)\n",
444471
"\n",
445472
"- [The Python Language Reference](https://docs.python.org/3/reference/index.html)\n",
446473
"- [Programiz - Python](https://www.programiz.com/python-programming/)"

basic/imgs/data_types_methods.png

33.7 KB
Loading

0 commit comments

Comments
 (0)