The Python Programming Open book

Preface

This book was written based on lecture notes by Hussain Almohri for the course CS126 taught at Kuwait University. The notes were written and revised over nine years of teaching and continue to be updated today. The lessons are designed to be comprehensible by students with absolutely no background in computing or even computers.

The author has taken a bottom-up approach, starting with computer hardware and basics that make up a computer, followed by variable declaration, use of built-in functions, basic data structures, all the way through conditionals, repetition, functions, and ending with problem-solving techniques. The use of complicated programming tricks and problem-solving techniques is avoided to help the reader go through the mental process of building efficient and usable programs. When possible, mathematical tricks for simplification and elegance are not used to reduce confusion.

The course that led up to creating this open book was taught to students who are overwhelmingly weak in using the English language. Thus, the author has attempted to simplify the language used in the description of techniques and language features.

The material in the book gives a tour of the Python language in a problem-agnostic manner until introducing repetition statements. Examples do not necessarily follow useful programs, and problem-solving is minimal. When repetition statements are introduced, the book touches upon simple problems, often with readily available methods and functions provided by the Python language itself. For example, students are taught to program a function to compute the maximum element in a list. This approach helps in enabling students with a simple testing strategy of comparing their results with the available functions and methods in Python.

Index

Edition 1. Last updated Feb 2022.