Python Course Notebooks

Welcome to Python Course Notebooks. These are a set of FREE interactive notebook tutorials for anyone interested to learn the Python programming language. The notebooks include interactive code and exercises from beginner up to advanced level, plus tutorials on Flask and Django web development frameworks.

You are welcome to use these notebooks whether you are new to programming or just new to Python. Become the software engineer you always wanted to be!

Let's Get Started!

You have two options in accessing the notebooks:

You will be redirected to your own Python Course server. Choose a course, and you're ready to go. This is recommended for beginners because no installations are necessary. Every few minutes, idle servers are disposed and a new one is made to replace it.

There are a few prerequisites:

  • a. Git
  • b. Python 3
  • c. Pip
  • d. Jupyter

This may take a few minutes to set up, but the good thing about this option is that you're going to have a copy of the notebooks on your own computer. That means you'll be able to save your progress unlike the web version. This is recommended for more experienced users.

Tutorials

For tutorials on how to use the notebooks, see the video below:

Table of Contents

Beginner I
01. Hello World
  Introduction
02. Introspection
  2.1 Starting the Python interpreter in interactive mode
  2.2 help()
  2.3 dir()
03. Coding Style
  3.1 Whitespace
  3.2 Indentation
  3.3 Comments
  3.3.1 Single-line comments
  3.3.2 Multi-line comments
  3.4 Single-line statements
  3.5 Multi-line statements
  3.6 PEP 8
04. Operators and Delimiters
  4.1 Operators
  4.1.1 Arithmetic Operators
  4.1.2 Assignment Operators
  4.1.2.1 Augmented Assignment
  4.1.3 Boolean Operators
  4.1.4 Membership Operators
  4.1.5 Identity Operators
  4.1.6 Comparison Operators
  4.1.7 Difference between 'is' and '=='
  4.2 Delimiters
  4.2.1 Brackets
  4.2.2 Curly Braces
  4.2.3 Parenthesis
  4.2.4 Triple double/single quotes
Beginner II
01. Built-in Functions
  1.1 input()
  1.2 print()
  1.3 type() checking
  1.4 casting
  1.4.1 Converting String into a Proper Number
02. Variables
  2.1 Identifier Naming Rules
  2.2 Reserved Words
  2.3 Conventions
  2.4 Multiple Assignment
  2.4.1 Re-assigning of Variables
  2.5 Comparison Chaining
  2.6 Data Types
  2.6.1 Numbers
  2.6.2 String
  2.6.3 List
  2.6.4 Tuples
  2.6.5 Dictionary
  2.7 Namespace
3.1 Data Types - Booleans
  3.1.1 Booleans and Logical Operators
3.2 Data Types - Numbers
  3.2.1 Numeric Types
  3.2.2 min()
  3.2.3 max()
  3.2.4 abs()
  3.2.5 sqrt()
3.3 Data Types - Strings
  3.3.1 Quotations
  3.3.2 Escape or Slash Characters
  3.3.3 Methods
  3.3.4 String formatting
  3.3.5 String Slicing
3.4 Data Types - Lists
  3.4.1 Accessing values in list
  3.4.2 Methods
  3.4.3 Slicing
  3.4.4 Math Operators
3.5 Data Types - Tuples
  3.5.1 Accessing values in a tuple
  3.5.2 Methods
3.6 Data Types - Dictionaries
  3.6.1 Accessing values in a dictionary
  3.6.2 Adding new entries
  3.6.3 Changing the entries
  3.6.4 Deleting the entries
  3.6.5 Other Methods
Beginner III
01. Loops and Iteration
  1.1 while
  1.2 for in..else
  1.2.1 range()
  1.2.2 enumerate()
  1.3 loop control
  1.3.1 continue
  1.3.2 break
  1.4 else
02. Conditional Statements and Expression
  2.1 if, elif, else
  2.1.1 Conditional Statement
  2.1.2 Conditional Expression
  2.2 Truth Value Testing
  2.3 Boolean Operators - and, or, not
  2.4 == vs is; None
03. Exception Handling
  3.1 try
  3.2 except
  3.2.1 Exceptions
  3.2.2 raising Exceptions
  3.3 else
  3.4 finally
04. Defining and Calling Functions
  4.1 Defining a Function
  4.2 Positional Arguments
  4.3 Keyword Arguments
  4.4 Default Values
  4.5 Argument Syntax
  4.6 Starred Arguments
  4.7 Packing and Unpacking Arguments
  4.8 Lambda Functions
  4.9 Late Binding
05. End of Chapter
Intermediate I
01. Basic OOP in Python (Classes and Objects)
  1.1 Defining a class
  1.1.1 Old and New Style Classes
  1.1.2 Introspection
  1.2 Docstrings
  1.3 Language-defined "special", "magic" or "dunder" methods
  1.3.1 __str__
  1.3.2 __init__
  1.4 Method Resolution Order
  1.5 Multiple Inheritance
  1.6 Super
  1.7 Packing/Unpacking Method Arguments
02. Virtual Environment
  2.1 Installation
  2.1.1 For Python ver. < 3.3
  2.1.2 For Python ver. >= 3.3
  2.1.3 For Anaconda Users
  2.2 virtualenvwrapper
  2.1.2 For Python ver. >= 3.3
03. Importing Modules
  3.1 Python's Import System
  3.1.1 Modules
  3.1.1.1 os.path
  3.1.1.2 os.environ
  3.1.2 Local Packages
  3.1.3 Aliasing
  3.1.4 Multiple Imports
  3.2 Common Modules
  3.2.1 datetime
  3.2.2 random
  3.2.3 json
  3.2.4 requests
Intermediate II
01. Sets
  1.1 Creating a set
  1.2 Methods and Operations
  1.2.1 add()
  1.2.2 clear()
  1.2.3 copy()
  1.2.4 union()
  1.2.5 intersection()
  1.2.6 difference()
  1.2.7 symmetric_difference()
  1.2.8 Membership
  1.2.9 Other Methods and Operators
  1.2.10 Why bring up sets?
02. List/Set/Dictionary Comprehension
03. Generators
  3.1 Generator Expressions
  3.2 Generator Function
04. With Statement
  4.1 Context Expressions and Managers
Intermediate III
01. Namespaces
  1.1 LEGB
  1.2 Rebinding Variables
  1.3 Default Keyword Arguments
  1.4 Late Binding Closures
02. Regular Expressions
  2.1 Functions
  2.1.1 re.match() and re.search()
  2.1.2 re.compile()
  2.1.3 re.split()
  2.1.4 re.findall()
  2.1.5 re.finditer()
  2.1.6 re.fullmatch()
  2.1.7 re.sub() and re.subn()
03. Best Practices
  3.1 PEP8
  3.2 print()
  3.3 If
  3.4 For
  3.5 Functions
  3.6 Variables
  3.7 Strings
  3.8 Lists
  3.9 Tuples
  3.10 Dictionaries
  3.11 Sets
  3.12 Classes
  3.13 Generators
  3.14 Docstrings
  3.15 Imports
  3.16 os.path
  3.17 Libraries
04. End of Chapter
Advanced I
01. Decorators
02. ORMs
  2.0.1 Pros
  2.0.2 Cons
02.1 SQLAlchemy
  2.1.1 Declaring a Mapping
  2.1.2 Configuring a Database Engine
  2.1.3 Creating the Schema
  2.1.4 Creating a Session
  2.1.5 Creating an Instance
  2.1.6 Adding and Updating Objects in the Session
  2.1.7 Rolling Back the Session
  2.1.8 Querying the Session
2.2 Peewee
  2.2.1 Model Definition
  2.2.2 Creating the Database
  2.2.3 Storing data
  2.2.4 Updating Data
  2.2.5 Removing Data
  2.2.6 Autocommit
  Context Manager
  Decorator
  2.2.7 Retrieving Data
  Getting single records
  Lists of records
03. End of Chapter
Web Development I : Flask
01. Flask Framework
  1.1 Function Based Views
  1.2 Class Based Views
  1.3 Request Object
02. Templating Engine
  2.1 Template Inheritance
  2.2 Control Structures
03. Form Handling: WTF Forms
04. Modules (Debugging and Logging)
  4.1 pdb
  4.2 logging
Web Development II : Django
01. Introduction to Django
02. Settings.py
03. Django Models and ORM
04. Views and URLs
05. Templates and Forms
06. End of Chapter

The Python Course Notebooks are used internally at KLab Cyscorpions for Python Training and they are making them publicly available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Do you like what you see?

Let's Work Together!
IT & Business Process Association Philippines Game Developers Association of the Philippines Philippine Software Industry Association