Table of Contents
Getting Started
Features of Python
Python download and Installation
Python Idle
Python Syntax
Keywords
Variables
User Input / Output
input() function
console read() / readline() function
print() function
console write() function
Operators
Unary Operator (Negation -)
Arithmetic Operators (+, -, *, /, //, %, **)
Bitwise Operators (&, |, ^, >>, <<, ~)
Assignment Operators (=, +=, -=, /=, //=)
Comparison Operator (==, !=, >, <, >=, <=)
Logical Operators (and, or, not)
Identity Operators (is, is not)
Membership Operators (in, not in)
Data Types
Basic Datatype
Boolean
Integers
Floating Point Numbers
Complex Numbers
Strings
None
Built in data structures
Lists
List Comprehension
Tuples
Sets and Frozen Set
Dictionaries
Type Casting
Control Flow
The if statement
The for statement (and range() function)
The while statement
The try statements
The break statement
The continue statement
The pass statement
The exit() function
The return statement
Functions
Function Definition
The Main Function
Scopes of Variables Inside Functions (global and nonlocal statements)
Default Argument Values
Keyword Arguments
Arbitrary Argument Lists
Unpacking Argument Lists (* and ** statements)
Lambda function
Function Documentation
Function Annotations
Function Decorators
Classes
Class Definition (class statement)
Class Objects
Instance Objects
Method Objects
Class and Instance Variables
Inheritance
Multiple Inheritance
Modules
Modules (import statement)
Packages
Errors and Exceptions
Handling Exceptions (try statement)
Raising Exceptions (raise statement)
User defined exceptions
Files
Create, Read, Write and Append text files
Use of with statement
Read a file from backwards to understand seek and set file pointer
Create, Read, Write and Append binary file
Generators
yield statement
The next() function
Decorators
chain/ wrapper
Python Standard Libraries
System (sys)
Serialization (json library)
File Wildcards (glob library)
String Pattern Matching (re library)
Mathematics
Dates and Times (datetime library)
Data Compression (zlib library)
0 Comments