Save As command (File menu), 11
saving programs, 11
scale_image() function, 431
scopes, 178
scorekeeping, 416, 418
screen boundaries, 358–360
Screen class, 342
attributes, 424
height attribute, 424
methods, list of, 343, 425
screen parameter, Games_Object class, 426
script mode, IDLE, 11–12
self-documenting code, 35
sending messages, 263
sentry variables, 68–69
sequences
defined, 92
immutable, 104–105
mutable, 104–105
nested
accessing elements in, 141–142
creating, 140–141
defined, 139
unpacking, 142
sequential access, 99
set() method, 251
set_background() method, 343, 425
set_bottom() method, 351
set_left() method, 351, 368
set_right() method, 351
set_text() method, 428
set_top() method, 351
set_velocity() method, 351, 360
shared references, 144–147
shelving, 211–213
Shinners, Pete, 339
shortcuts, to slices, 112
Silly Strings program, 26
Simple Game program example, 281
single inheritance, 269
size attribute, Text class, 428
slices
creating, 112
defined, 108
deleting from lists, 134
end points, 111
lists, 131, 133
Pizza Slicer program example, 109–110
shortcuts to, 112
tuples, 119
software reuse, 176
sort() function, 137–138
sound. See also music
loading, 388–389
looping, 390
methods for, 431
playing, 389–390
stopping, 390–391
Special Topics, Python Web site, 7
Sprite class, 342, 429
sprites
creating, 356
init_sprite() method, 353
loading images from, 354–355
moving, 356–358
overview, 350–351
rotating, 382–384
uses for, 352
statements
from, 341
assignment, 34
break, 77–78
continue, 77–78
continuing on next line, 20
defined, 9
else, 62–63
if, 57–59, 61
if-elif-else, 63–66
if-else, 61–62
import, 55–56
return, 171
try, 214–215
static methods, 240
creating, 242–243
invoking, 243
staticmethod() function, 243
status() method, 242–243
stepwise refinement, 84–85
sticky parameter, grid() method, 319
stop() method, sound, 390–391, 431
stop_music() function, 431
stopping
music, 392
sound, 390–391
storing data in files, 208–213
str() function, 46, 239, 265–266, 280
string expression, 10
string methods, 38–41
strings
concatenating, 27
converting to integers, 45–46
creating new from old, 107–108
escape sequences with, 22–23
immutable, 104–105
mutable, 104–105
quotes inside, 20
quotes with, 18–19
repeating, 28, 50
sequence operators as, 97
Silly Strings program, 26
triple-quoted, 21
writing to text files, 206–207
StringVar class, 328
strip() method, 41
subtraction (-) operator, 31
superclasses, 277
swapcase() method, 41
sync() function, 212
syntax errors, 10
SyntaxError exception type, 215
sys.exit() function, 220
system bell, 23