From df37e76f8702a4db272160467ae8e8ed45685522 Mon Sep 17 00:00:00 2001 From: Ankit Mahato Date: Sat, 29 Oct 2022 20:37:05 +0530 Subject: [PATCH] Update README.md --- README.md | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 177 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6496896..802f093 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,184 @@ by **Ankit Mahato** This book can be consumed in 3 ways: -## A nice web interface -[Link]() +- A nice web interface - [Link](https://animator.github.io/learn-python/) +- A Downloadable PDF - [Link]() +- Directly on GitHub - [Link](https://github.com/animator/learn-python) -## A Downloadable PDF -[Link]() -## Directly on GitHub -[Link]() +Table of Contents +================= +* [Introduction](#introduction) + * [Introduction to Programming Languages](#introduction-to-programming-languages) + * [Introduction to Python](#introduction-to-python) + * [Advantages of Python](#advantages-of-python) + * [Installing Python in Windows](#installing-python-in-windows) + * [Installing Python in macOS (Apple)](#installing-python-in-macos-apple) + * [Execution Modes](#execution-modes) + * [Interactive Mode of Execution](#interactive-mode-of-execution) + * [Script Mode of Execution](#script-mode-of-execution) +* [Python Fundamentals](#python-fundamentals) + * [Tokens: Introduction](#tokens-introduction) + * [Tokens: Keywords](#tokens-keywords) + * [Tokens: Identifiers](#tokens-identifiers) + * [Tokens: Literals](#tokens-literals) + * [Tokens: Operators](#tokens-operators) + * [Tokens: Delimiters](#tokens-delimiters) + * [Character Set](#character-set) + * [Blocks and Indentation](#blocks-and-indentation) + * [Comments](#comments) +* [Variables, Objects & Data Types](#variables-objects--data-types) + * [What are Objects & Variables?](#what-are-objects--variables) + * [Variables & Assignment Statements](#variables--assignment-statements) + * [Built-in Data Types](#built-in-data-types) + * [Type Checking](#type-checking) + * [Type Casting](#type-casting) + * [Implicit Type Casting](#implicit-type-casting) + * [Explicit Type Casting](#explicit-type-casting) + * [Mutable & Immutable Data Types](#mutable--immutable-data-types) + * [Immutable Data Types](#immutable-data-types) + * [Mutable Data Types](#mutable-data-types) +* [Input / Output](#input--output) + * [How to Accept User Input](#how-to-accept-user-input) + * [Displaying Output](#displaying-output) +* [Operators & Expressions](#operators--expressions) + * [Introduction to Operators](#introduction-to-operators) + * [Arithmetic Operators](#arithmetic-operators) + * [Relational Operators](#relational-operators) + * [Assignment Operators](#assignment-operators) + * [Logical Operators](#logical-operators) + * [Identity Operators](#identity-operators) + * [Membership Operators](#membership-operators) + * [Expressions](#expressions) + * [Operator Precedence with Examples](#operator-precedence-with-examples) +* [Errors & Exception Handling](#errors--exception-handling) + * [Error Types](#error-types) + * [Syntax Error](#syntax-error) + * [Runtime Error](#runtime-error) + * [Logical Error](#logical-error) + * [Exceptions](#exceptions) + * [Exception Handling](#exception-handling) +* [Control Flow](#control-flow) + * [Introduction to Control Flow](#introduction-to-control-flow) + * [Sequential Flow](#sequential-flow) + * [Selection Statements: if .. else](#selection-statements-if--else) + * [Iteration: for](#iteration-for) + * [Iteration: while](#iteration-while) + * [Jump Statements](#jump-statements) + * [pass](#pass) + * [break](#break) + * [continue](#continue) + * [Nested Loops](#nested-loops) +* [Strings](#strings) + * [Strings: Introduction & Creation](#strings-introduction--creation) + * [Accessing Characters of a String](#accessing-characters-of-a-string) + * [String Operations](#string-operations) + * [Introduction to String Methods](#introduction-to-string-methods) + * [Convert Case of Strings](#convert-case-of-strings) + * [Check Characters of a String](#check-characters-of-a-string) + * [Split a String](#split-a-string) + * [Strip Characters from a String](#strip-characters-from-a-string) + * [Check Prefix or Suffix in a String](#check-prefix-or-suffix-in-a-string) + * [Find & Replace Characters in a String](#find--replace-characters-in-a-string) + * [Traversing a String](#traversing-a-string) +* [List](#list) + * [What is a Python List? How to Create a List?](#what-is-a-python-list-how-to-create-a-list) + * [Accessing Items of a List](#accessing-items-of-a-list) + * [Negative Indexing](#negative-indexing) + * [Modifying a List](#modifying-a-list) + * [Removing Item from a List](#removing-item-from-a-list) + * [List Operations](#list-operations) + * [Traversing a List](#traversing-a-list) + * [Built-in Functions that can be used for a List](#built-in-functions-that-can-be-used-for-a-list) + * [Introduction to List Methods](#introduction-to-list-methods) + * [Adding Items to a List](#adding-items-to-a-list) + * [Removing Items from a List](#removing-items-from-a-list) + * [Counting or Locating Items in a List](#counting-or-locating-items-in-a-list) + * [Reversing Items](#reversing-items) + * [Sorting a List](#sorting-a-list) + * [Copying a List](#copying-a-list) + * [Nested List](#nested-list) + * [List Comprehension](#list-comprehension) + * [Member-wise Operation](#member-wise-operation) + * [Filtering or Subsequence](#filtering-or-subsequence) + * [Sample Programs](#sample-programs) +* [Tuple](#tuple) + * [List vs Tuple](#list-vs-tuple) + * [How to Create Tuple?](#how-to-create-tuple) + * [What is a Singleton?](#what-is-a-singleton) + * [Accessing Items of a Tuple](#accessing-items-of-a-tuple) + * [Tuples are Immutable](#tuples-are-immutable) + * [Tuple Operations](#tuple-operations) + * [Traversing a Tuple](#traversing-a-tuple) + * [Built-in Functions that can be used for a Tuple](#built-in-functions-that-can-be-used-for-a-tuple) + * [Locating Items in a Tuple](#locating-items-in-a-tuple) + * [Counting the Occurrence of an Item](#counting-the-occurrence-of-an-item) + * [New Tuple with Reversed Items](#new-tuple-with-reversed-items) + * [New Tuple with Sorted Items](#new-tuple-with-sorted-items) + * [Nested Tuple](#nested-tuple) + * [Understanding the Immutable Nature of Tuples](#understanding-the-immutable-nature-of-tuples) +* [Dictionary](#dictionary) + * [What is a Dictionary?](#what-is-a-dictionary) + * [How to Create a Dictionary](#how-to-create-a-dictionary) + * [Key: Value Pairs](#key-value-pairs) + * [Sequence of (key, value) Tuples](#sequence-of-key-value-tuples) + * [Keyword/Named Arguments](#keywordnamed-arguments) + * [Key and Value Lists](#key-and-value-lists) + * [Keys with Default Value](#keys-with-default-value) + * [Accessing Items (Key:Value) of a Dictionary](#accessing-items-keyvalue-of-a-dictionary) + * [Updating a Dictionary](#updating-a-dictionary) + * [Removing an Item (Key:Value) from a Dictionary](#removing-an-item-keyvalue-from-a-dictionary) + * [Dictionary Operations](#dictionary-operations) + * [Traversing a Dictionary](#traversing-a-dictionary) + * [Built-in Functions for a Dictionary](#built-in-functions-for-a-dictionary) + * [Creating a Copy of a Dictionary](#creating-a-copy-of-a-dictionary) + * [Nested Dictionary](#nested-dictionary) + * [Sample Programs](#sample-programs-1) +* [Python Standard Library](#python-standard-library) + * [Built-in Functions](#built-in-functions) + * [Mathematical Functions](#mathematical-functions) + * [Type Functions](#type-functions) + * [Type Checking](#type-checking-1) + * [Built-in Type Functions](#built-in-type-functions) + * [I/O Functions](#io-functions) + * [Base/Unicode Conversion Functions](#baseunicode-conversion-functions) + * [What are Built-in Modules?](#what-are-built-in-modules) + * [math Module](#math-module) + * [Constants](#constants) + * [Functions](#functions) + * [random Module](#random-module) + * [statistics Module](#statistics-module) +* [File Handling](#file-handling) + * [File Handling in Python - Introduction & Overview](#file-handling-in-python---introduction--overview) + * [Text Files vs Binary Files - Use Case, File Formats, Examples](#text-files-vs-binary-files---use-case-file-formats-examples) + * [File Opening & Closing](#file-opening--closing) + * [File Reading](#file-reading) + * [Sequential Reading](#sequential-reading) + * [Ad-hoc Reading](#ad-hoc-reading) + * [Writing a File](#writing-a-file) + * [Reading & Writing Binary Files using pickle Module](#reading--writing-binary-files-using-pickle-module) + * [Dumping Data](#dumping-data) + * [Loading Data](#loading-data) + * [Example: Traversing a Binary File](#example-traversing-a-binary-file) + * [Reading & Writing a CSV File using csv Module](#reading--writing-a-csv-file-using-csv-module) + * [Reading CSV File](#reading-csv-file) + * [Writing CSV File](#writing-csv-file) +* [User Defined Functions, Modules & Packages](#user-defined-functions-modules--packages) + * [User Defined Functions](#user-defined-functions) + * [Function Structure](#function-structure) + * [Function Header](#function-header) + * [Function Body](#function-body) + * [Parameters and Arguments](#parameters-and-arguments) + * [Scope of Variables](#scope-of-variables) + * [Local Variables](#local-variables) + * [Global Variables](#global-variables) + * [Passing Objects of Mutable Type to a Function](#passing-objects-of-mutable-type-to-a-function) + * [Passing a List](#passing-a-list) + * [Passing a Dictionary](#passing-a-dictionary) + * [What is a Module? How to Create a Module?](#what-is-a-module-how-to-create-a-module) + * [Executable Scripts / Modules](#executable-scripts--modules) + * [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) # Introduction @@ -584,7 +753,7 @@ sum_6 = (1 + 2 + 3 + 4 + 5 + 6) Tokens in Python which are used for punctuation, decoration and annotation are: -``` python +``` . , : ; @ -> ``` @@ -593,7 +762,7 @@ Tokens in Python which are used for punctuation, decoration and annotation are: The assignment or binding delimiters are used for binding objects to names via assignment statements. The complete list of tokens are provided below: -``` python +``` = += -= *= /= //= %= **= @= &= |= ^=