Python Tutorial
There is a Python, pithy. Mighty, lissome, and tabby. Algorithms it puffs, Conundrums it snuffs. And cherished by those savvy.
This tutorial is:
- For beginners. Especially for mathematicians and scientists who never coded Python before.
- Written in the most simple way you can understand. But not assuming you are children.
- Written in a cold style. No ninja zen no joke.
- Example based. Standalone code for every concept.
- Plain English. Things explained in terms of what keyword and syntax do. No unnecessary jargon. (e.g. No “object oriented”, no “design patterns”.)
Table of Contents
Python
Overview
Help
Comment
String
- Python: Quote String
- Python: Triple Quote String
- Python: Raw String
- Python: String Prefix Char
- Python: f-String (Format, Template)
- Python: String Escape Sequence
- Python: Print String
- Python: Print Without Newline
- Python: Convert to String
- Python: Join String
- Python: Format String
- Python: String Methods
- Python: Search Substring
- Python: Split String
- Python: String, Check Case, Char Class
- Python: Letter Case Conversion
Arithmetic
- Python: Operators
- Python: Assignment Operators
- Python: Convert Int, Float, String
- Python: Bitwise Operators
Boolean
- Python: Boolean. True False
- Python: Boolean Operators
- Python: Test Equality
- Python: Test Order (Greater, Lesser)
Conditional
Loop, Iteration
Data Structure
- Python: List
- Python: Generate List: range
- Python: List Comprehension
- Python: List Methods
- Python: Iterate List
- Python: Map f to List
- Python: Filter List
- Python: Iterator to List
- Python: Copy Nested List, Shallow Copy vs Deep Copy
- Python: Interweave Lists to Tuples, Transpose
- Python: Sort
- Python: Convert List to Dictionary
Function
- Python: Function
- Python: Function Keyword Arguments
- Python: Lambda
- Python: Closure
- Python: Decorator
Class
Module
- Python: Import Module
- Python: Show Module Doc
- Python: List Module Functions
- Python: List Modules, List Loaded Modules
- Python: Module Search Paths
- Python: How to Write a Module
Regex
- Python: Regex
- Python: Regex Functions
- Python: Regex Object and Methods
- Python: Regex Match Object
- Python: Regex Syntax
- Python: Regex Flags
Read Write File
- Python: Read File
- Python: Write to File
- Python: Walk Directory, List Files
- Python: File Path Functions
- Python: Get Script Path
Unicode, Encoding
- Python: Unicode 🐍
- Python 2: Unicode Tutorial
- Python: Allowed Characters in Identifiers
- Python: Set STDOUT Encoding to UTF-8
- Python: Unicode Escape Sequence
- Python: Get Unicode Name, Codepoint
- Python: Convert File Encoding
Misc
- Python: Format Code
- Python: Datetime
- Python: Timing, Benchmark
- Python: Get Environment Variable
- Python: System Call
- Python: Get Command Line Args
- Python: Compress Decompress Gzip File
- Python: Get Image Size
- Python: Transpose Matrix
Script Examples
- Python: Find Replace Text in a Directory
- Python: Find Replace Multi-Pairs Regex in a Directory
- Python: Count Word Frequency
Web Examples
Testimonials

