This document repository introduces you to Python programming. Most people have fun in learning Python and they can make big profit if they have big fun: programming teachs you how to think.
Unlike most textbooks or tutorials, we write this document with an important principle: teaching the professional way of Python programming. "Professional" means the best practices in Python programming used by professional programmers. Following is a short list of best practices we follow in this document:
- Design with test cases before coding.
- Follow the PEP 8 - Style Guide for Python Code and use VS Code PyLint tool to enforce the style.
- No magic numbers.
- Short functions/methods.
- Design, code, test and debug incrementally.
- Refactoring is part of development.
All lecture videos are in Youtube PlayLists.
The followin is table of content. It is organzied based on topics, not on a textbook chpater order. As a program, you count from 0
:
- Command Line Interface: introduction of command line tool. Please read and learn this first if you don't know CLI. It is must-to-know for a programmer.
- Install Python Interpreter: how to install Python.
- Install and setup VS Code for Python Development: how to install and setup Visual Studo Code (VS Code) for Python development.
- Git and GitHub: use GitHub to manage your software source code. YouTube Video: GitHub and GitHub.
- Introduction: how a computer runs programs, programming languages, compiler and interpreter. YouTube Video: Introduction to Programming.
- Program Design: the software development life cycle, flowcharts and pseudo-code.
- Getting Started with Python in VS Code: develop and run Pythin programs using VS Code. YouTube Video: Python in VS Code.
- Hello World: Using
print
to say "hello world" and learn string and comment. YouTube Video: Hello World. - Variable Declaration and Naming: variable assignment and its naming conventions. YouTube Video: variable assignment naming.
- Types and Operations: data types and operations. YouTube Video: Types and Operations
- Reading Input: reading input of different types. YouTube Video: Reading Input
- F-string: format string literals in different ways. YouTube Video: Formatted String
- Code demo: Turtle Graphics: introduce the built-in
turtle
module.
- Boolean Expression: introduce the control structure concepts and Boolean expressions. YouTube Video.
- Decision Structure: introduce the decision structure of if, else and elif. It also covers the important concept of code block. YouTube Video.
- Code demo: Hit the target
- While Loop: the while loop and
infinite
loop. YouTube Video. - For Loop: sequence of data times and
for
loop. YouTube Video. - Continue and Break: the
continue
andbreak
statement. YouTube Video. - Code demo: Factorial and Spiral Circle
- Function Concepts: function concept, definition and call. YouTube Video
main
and Scope: themain
function and variable scopes. YouTube Video- Module: module concepts and built-in modules. YouTube Video
- Code demo: Hit the target
- Read and Write: read and write files. YouTube Video.
- Record and Operation: record and other file operations. YouTube Video.
- Errors and Exceptions: program errors and exceptions. YouTube Video.
- Handling Exception: handling program exception. YouTube Video.
-
Classes and Objects YouTube Videos