Preface#
This site contains a set of lecture notes (the “book”) for the Python components of IST-5551, Foundations of Computing and Programming for Data Science, offered by the Jaggi Business School at Missouri S&T in Rolla, Missouri. It was inspired in part by Dr. Allen Downey’s Think Python book.
At a Glance#
Each chapter in this book builds on the previous ones, so you should read them in order and take time to work on the exercises before you move on.
Part I: Fundamentals: Core Python concepts such as statements, expressions, operators, built-in data types, conditionals, loops, functions, exceptions, and testing.
Part II: Data Structures: Python’s main data structures – lists, tuples, dictionaries, and sets – along with strings, regular expressions, and text analysis.
Part III: Program Design: Object-oriented programming, functional programming, iterators, generators, and APIs.
Part IV: Algorithms & Data Structures: Abstract data structures, algorithm design, searching, and sorting.
Appendices: Practical setup topics such as tooling, Python installation, virtual environments, Jupyter notebooks, and related workflow tips.
Chapter Topics#
The chapters progress from Python fundamentals, control flow, functions, and testing to core data structures and text processing, then to program design with objects, functional tools, iterators, and APIs, and finally to abstract data structures and algorithms. Preview, Lab, and Homework activities accompany each chapter.
Chapter |
Topics |
|---|---|
Natural and formal languages; levels of abstraction; interpreted and compiled languages; expressions and statements; number systems and character encoding; indentation and statement formatting; input, output, and f-strings; built-in functions, modules, and packages. |
|
Variables and naming conventions; objects, types, identity, and mutability; aliasing; assignment, arithmetic, and comparison operators; truthiness, membership, and identity; logical and bitwise operators; type checking, conversion, and hinting; strings and collection types. |
|
|
|
Defining functions and encapsulation; parameters, default values, |
|
Types of errors and tracebacks; |
|
Creating and accessing lists; list comprehensions and nested lists; list operators, functions, and methods; |
|
Creating dictionaries; accessing, updating, and deleting items; membership testing; dictionary comprehensions; counting with |
|
Escape sequences, indexing, and slicing; string methods for searching, cleaning, splitting, and formatting; comparing and sorting strings; regular expressions with the |
|
Classes and instances; methods, |
|
Pure functions and immutability; functions as values; higher-order functions; decorators; comprehensions and choosing a style; recursion versus iteration; context managers; |
|
The iterator protocol; built-in lazy iterators; custom iterator classes; generator functions; generator expressions; infinite sequences and |
|
Reading an API contract; GET requests with |
|
Abstract types and implementations; operation tradeoffs; stacks; queues; trees; graphs and graph traversal. |
|
Properties of algorithms; the design process; complexity and Big O; benchmarking; linear and binary search; the |
Set up your environment with Course Tooling and Jupyter Setup in the appendices before the first lab.
How to Use This Book#
Each chapter section is an interactive Jupyter Notebook. You can:
Read through the rendered content
Interact with the code directly by downloading the notebooks locally or using Binder
Use the Live Code cells for practice
Live Coding#
Some sections include exercises that support live coding. To enable them, click the Live Code button. It may take some time to launch a new session; wait until you see a “ready” message. The live coding cells let you practice the concepts and skills introduced in each section.
Credits#
Parts of these notes are adapted from Think Python by Dr. Allen Downey.
Videos throughout this book are embedded via YouTube’s official player and remain the property of their original creators. No ownership or affiliation is claimed. Embedded videos may become unavailable if creators remove them or disable embedding. Rightsholders with concerns may contact support@thinkpy.org.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.