cussion of what computer science is and what developers do, the concepts of modeling,
algorithm development, and programming are defined. The chapter describes the computer
scientist’s and application developer’s toolkit, from logic to systems, with an emphasis on
programming languages, the Python development environment, and computational think-
Chapter 2 covers core built-in Python data types: the integer, Boolean, floating-point,
string, list, and tuple types. To illustrate the features of the different types, the Python interac-
tive shell is used. Rather than being comprehensive, the presentation focuses on the purpose
of each type and the differences and similarities between the types. This approach motivates
a more abstract discussion of objects and classes that is ultimately needed for mastering the
proper usage of data types. Case Study CS.2 takes advantage of this discussion to introduce
Turtle graphics classes that enable students to do simple, fun graphics interactively.
Chapter 3 introduces imperative and procedural programming, including basic execu-
tion control structures. This chapter presents programs as a sequence of Python statements
stored in a file. To control how the statements are executed, basic conditional and iterative
control structures are introduced: the one-way and two-way if statements as well as the
simplest for loop patterns of iterating through an explicit sequence or a range of numbers.
The chapter introduces functions as a way to neatly package a small application; it also
builds on the material on objects and classes covered in Chapter 2 to describe how Python
does assignments and parameter passing. Case Study CS.3 uses the visual context of Turtle
graphics to motivate automation through programs and abstraction through functions.
The first three chapters provide a shallow but broad introduction to Python program-
ming and computers science. Core Python data types and basic execution control structures
are introduced so students can write simple but complete programs early. Functions are in-
troduced early as well to help students conceptualize what a program is doing, that is, what
inputs it takes and what output it produces. In other words, abstraction and encapsulation of
functions is used to help students better understand programs.