Skip to main content
main-content
Top

About this book

This easy-to-follow and classroom-tested textbook guides the reader through the fundamentals of programming with Python, an accessible language which can be learned incrementally.

Features: incudes numerous examples and practice exercises throughout the text, with additional exercises, solutions and review questions at the end of each chapter; highlights the patterns which frequently appear when writing programs, reinforcing the application of these patterns for problem-solving through practice exercises; introduces the use of a debugger tool to inspect a program, enabling students to discover for themselves how programs work and enhance their understanding; presents the Tkinter framework for building graphical user interface applications and event-driven programs; provides instructional videos and additional information for students, as well as support materials for instructors, at an associated website.

Table of Contents

Chapter 1. Introduction

The intent of this text is to introduce you to computer programming using the Python programming language.
Kent D. Lee

Chapter 2. Decision Making

In this chapter we explore how to make choices in our programs. Decision making is valuable when something we want to do depends on some user input or some other value that is not known when we write our program.
Kent D. Lee

Chapter 3. Repetitive Tasks

When my children were very little I played with them and read books to them. If they were particularly entertained I would get the, “Do it again!”, command from them. And, of course, I did it or read it again.
Kent D. Lee

Chapter 4. Using Objects

In this chapter we explore objects and code re-use. Python is an object-oriented language and learning to use objects can make programming fun and productive. In this chapter we’ll explore object-oriented programming by using the turtle module.
Kent D. Lee

Chapter 5. Defining Functions

Functions are something most of us are familiar with from Mathematics.
Kent D. Lee

Chapter 6. Event-Driven Programming

When a program runs in Python the Python interpreter scans the program from top to bottom executing the first statement that is not part of a function definition.
Kent D. Lee

Chapter 7. Defining Classes

Python is an object-oriented language. This means, not only can we use objects, but we can define our own classes of objects. A class is just another name for a type in Python. We have been working with types (i.e. classes) since the first chapter of the text. Examples of classes are int, str, bool, float and list.
Kent D. Lee

Chapter 8. Appendix A: Integer Operators

This documentation was generated from the Python documentation available by typing help(int) in the Python shell.
Kent D. Lee

Chapter 9. Appendix B: Float Operators

This documentation was generated from the Python documentation available by typing help(float) in the Python shell.
Kent D. Lee

Chapter 10. Appendix C: String Operators and Methods

This documentation was generated from the Python documentation available by typing help(str) in the Python shell.
Kent D. Lee

Chapter 11. Appendix D: List Operators and Methods

This documentation was generated from the Python documentation.
Kent D. Lee

Chapter 12. Appendix E: Dictionary Operators and Methods

This documentation was generated from the Python documentation available by typing help(dict) in the Python shell.
Kent D. Lee

Chapter 13. Appendix F: Turtle Methods

This documentation was generated from the Python documentation available by typing from turtle import * help(Turtle) in the Python shell.
Kent D. Lee

Chapter 14. Appendix G: TurtleScreen Methods

This documentation was generated from the Python documentation available by typing from turtle import * help(TurtleScreen)
Kent D. Lee

Chapter 15. Appendix H: The Reminder! Program

The Reminder! Program
Kent D. Lee

Chapter 16. Appendix I: The Bouncing Ball Program

The Bouncing Ball Program
Kent D. Lee
Additional information