Symbols
+= (addition and assignment operator), ,
+ (addition operator), ,
\ (backslash),
/ (division operator), , ,
= (equal sign),
== (equal to operator), , , ,
> (greater than operator), , ,
>= (greater than or equal to operator), ,
() (grouping operator), ,
# (hash mark),
// (integer division operator), , ,
< (less than operator), , ,
<= (less than or equal to operator), ,
% (modulo [mod] operator), , , ,
* (multiplication operator), ,
!= (not equal to operator), , ,
** (power [exponent] operator),
" (quotation marks),
' (single quotation marks),
[] (square brackets),
- (subtraction operator), ,
A
addition and assignment operator (+=), ,
addition operator (+), ,
algorithms, defined, , ,
American Standard Code for Information Interchange (ASCII) values, ,
and (logical operator), ,
animation,
(see also drawing)
bouncing
changing direction,
off four walls,
off one wall,
speed,
boundaries, ,
collision detection, , , , , , , , ,
defined,
frames,
game loop,
movement,
Pygame,
append() function,
appending, , ,
applications (apps; programs), defined, ,
arguments, , , ,
arrays, , ,
defined, ,
ArrowDraw.py program, , ,
ASCII (American Standard Code for Information Interchange) values, ,
assignment, of values to variables,
defined,
AtlantaPizza.py program, ,
attributes, defined,
B
backslash (\),
bgcolor() function, ,
binary search,
BLACK variable,
blit() function, , , ,
BMP format,
Boolean (conditional) expressions, , ,
comparison operators,
defined,
Boolean numbers,
bouncing (animation)
changing direction,
off four walls,
off one wall,
speed,
boundaries, for animations, ,
C
Caesar cipher, ,
callback functions,
calling functions, defined,
canvas size, determining,
Cartesian coordinates, , , ,
case sensitivity,
characters,
choice() function, , , ,
chr() function,
ciphers,
circle() function, , , , , ,
CircleSpiral1.py program, ,
CircleSpiralInput.py program,
classes,
(see also names of specific classes)
constructed,
container,
defined, ,
extending,
ClickAndSmile.py program, , ,
ClickDots.py program, ,
ClickKaleidoscope.py program, , ,
ClickSpiral.py program, ,
close window button (event),
Clock class,
coding, defined,
collide_circle() function,
collidepoint() function,
collide_rect() function,
collision detection, , , , , , , , ,
defined,
ColorCircleSpiral.py program, ,
ColorMeSpiralled.py program,
ColorPaint.py program,
colors,
changing background,
using multiple,
colors argument,
colorspiral module
building,
reusing,
using,
ColorSpiralInput.py program, , ,
ColorSpiral.py program, , ,
ColorSquareSpiral.py program, ,
colors variable, ,
comments,
defined,
docstrings,
usefulness of,
comparison operators, , , ,
complex conditions,
complex numbers,
compound if statements,
concatenation, ,
conditional expressions, defined,
(see also Boolean expressions; conditions)
conditions,
Boolean expressions, , ,
ciphers,
complex,
elif statements, , ,
else statements,
if statements (see if statements)
while statements,
constants, , ,
constructors,
container classes,
convert_in2cm() function,
convert_lb2kg() function,
count_popped variable,
count_smileys variable,
cspiral() function,
D
declaring (defining) functions, ,
defined,
def keyword,
Descartes, René,
diameter,
DiscoDot.py program,
division operator (/), , ,
docstrings,
downloading Python,
DragDots.py program, , ,
drawing,
(see also animation)
circles,
colors,
changing background,
using multiple,
dots,
multi-sided spirals,
square spirals
adjusted,
basic,
draw_kaleido() function, ,
draw_smiley() function, , ,
draw_spiral() function,
draw_string variable,
driving_age variable,
E
element, defined,
elif statements, , ,
else statements,
EncoderDecoder.py program, ,
end_fill() function,
end keyword,
equal sign (=),
equal to operator (==), , , ,
eval() function, , ,
evaluation, ,
event, defined,
event handlers (event listeners), , ,
close window button,
defined,
keyboard events, ,
mouse clicks, , ,
mouse presses and releases,
parameters,
in Pygame,
exponent (power) operator (**),
expressions
Boolean, , ,
defined, ,
in shell, ,
extending classes,
F
False value,
fillcolor() function,
fill() function, ,
FiveDice.py program, ,
flags, , ,
floating-point numbers, defined,
focus,
fonts (typefaces),
for loops, , , , , , , , ,
defined,
forward() function, , ,
frames, ,
frames per second (fps), ,
functions,
(see also names of specific functions)
callback,
calling,
defined, ,
defining, ,
interaction,
parameters,
returning values from,
using return values in programs,
utility of,
G
game keycodes,
game loops, , , , ,
animation,
handling mouse clicks,
handling mouse presses and releases,
ongoing play,
game programming,
(see also names of specific games)
adding difficulty,
adding points,
board and pieces,
displaying score,
elements of design,
game over,
hitting ball with paddle,
playing again,
sound,
subtracting lives,
tracking and displaying progress,
get() function, ,
get_height() function, , ,
get_pos() function, ,
get_pressed() function,
get_rect() function,
get_rel() function,
get_width() function, , ,
goto() function,
greater than operator (>), , ,
greater than or equal to operator (>=), ,
GREEN variable,
Group class,
grouping operator (()), ,
GuessingGame.py program, ,
guess variable,
H
hash mark (#),
heading() function, ,
height_cm variable,
height_in variable,
"Hello, world!" program,
hideturtle() function,
HighCard.py program, ,
Hi-Lo guessing game,
I
IDLE editor, , , , , ,
if-elif-else statements, ,
if-else statements,
IfSpiral.py program, ,
if statements, , , ,
defined,
games, ,
syntax,
importing code, defined, ,
indentation,
indexes
finding items in lists,
testing which value is higher,
index() function,
init() function, , , ,
__init__() function, ,
initialization, , ,
in keyword,
inner and outer loops,
input, defined,
input() function, , , ,
installing Pygame
for Linux,
for Mac,
for Windows,
installing Python,
for Linux,
for Mac,
for Windows,
integer division operator (//), , ,
integers, defined,
interaction,
(see also event handlers (event listeners))
classes and objects,
clicking,
collision detection,
dragging,
sprites,
removing,
scaling,
setting up,
updating,
int() function,
islower() function,
isupper() function, ,
iteration,
iterative versioning, defined, ,
K
kaleidoscope mirror effect, ,
Kaleidoscope.py program, , , ,
keep_going variable, , , ,
keyboard events, ,
keycodes, Pygame,
KEYDOWN event,
keyword arguments, ,
L
left() function, , , , , , ,
len() function, , ,
less than operator (<), , ,
less than or equal to operator (<=), ,
libraries, defined,
listen() function,
listeners (see event handlers (event listeners))
list() function,
lists, ,
defined, ,
finding items in, ,
load() function,
logical operators, ,
Logo programming language,
loops,
defined, ,
for, , , , , , , , , ,
game (see game loops)
nested, ,
repeating variables through,
user input,
using to cycle through colors,
while, , , , , , , , , ,
lower() function, ,
M
MadLib.py program,
MadLib2.py program,
math, in the Python shell,
math, in the Python shell,
(see also numbers)
MathHomework.py program, ,
methods, defined,
mobile apps,
modules
building,
defined,
reusing,
using,
modulo (mod) operator (%), , , ,
MOUSEBUTTONDOWN event, ,
MOUSEBUTTONUP event,
mouse clicks (events), , ,
mouse presses and releases (events),
movement (animation),
multiplication operator (*), ,
multi-sided spirals,
MultiSpiral.py program, ,
my_face variable,
my_name variable,
N
name variable,
nested loops, ,
NiceHexSpiral.py program,
not (logical operator), ,
not equal to operator (!=), , ,
number_of_circles variable,
numbers,
Booleans,
complex,
doing math in shell, ,
floating-point,
integers,
operators,
syntax errors, ,
numinput() function, , ,
O
object-oriented programming,
objects, defined,
OldEnoughOrElse.py program,
OldEnough.py program, ,
onkeypress() function,
onscreenclick() function, , , , ,
operators
comparison, , , ,
defined, ,
logical, ,
math,
programming with,
or (logical operator), ,
ord() function,
origin, ,
P
parameters,
defined,
for event handlers,
pencolor() function, , , , ,
pendown() function, ,
penup() function, , ,
picx variable, , , , ,
picy variable, , , , ,
PingPongCalculator.py program, ,
ping_pong_heavy variable,
ping_pong_tall variable,
pixels, defined, ,
PolygonOrRosette.py program, ,
Pong (game), ,
porting code, defined,
position() function,
pos parameter, ,
power (exponent) operator (**),
print() function, , ,
programming languages, defined,
programs (applications; apps), defined, ,
prompt
command,
input,
prototypes, defined,
pseudorandom numbers, ,
Pygame, , ,
classes and objects,
Clock class,
collision detection,
event handlers,
exiting program,
game loop,
get_height() function, , ,
get_width() function, , ,
Group class,
initializing,
installing,
for Linux,
for Mac,
for Windows,
keycodes,
scale() function,
setup,
sound,
Sprite class, ,
surfaces,
turtle graphics vs., ,
update() function,
pygame.draw module, ,
pygame module, ,
Python
defined,
documentation for,
downloading,
installing,
for Linux,
for Mac,
for Windows,
setup
for Linux,
for Mac,
for Windows,
website, ,
Q
QUIT event, ,
quit() function, , ,
quotation marks ("),
R
radius,
RainingDots.py program, ,
randint() function, , ,
RandomDots.py program, ,
random module,
choice() function, , , ,
importing,
randint() function, , ,
randrange() function, ,
randomness,
Hi-Lo guessing game,
kaleidoscope mirror effect,
random spirals,
choosing random colors,
coordinates,
determining canvas size,
Rock-Paper-Scissors game,
War-style card game,
building deck of cards,
continuing play,
counting cards,
dealing cards,
Yahtzee-style game,
probabilities,
setting up,
sorting dice,
testing dice,
RandomPaint.py program,
RandomSmileys.py function, , , ,
random_spiral() function,
calling,
defining,
RandomSpiralsFunction.py program, ,
RandomSpirals.py program, , , ,
randrange() function, ,
range, defined,
range() function, , , , ,
remove() function, ,
render() function,
returning (to new line),
return statement,
return values,
reusing code, , , , , ,
RGB color triplets, , , ,
right() function,
Rock-Paper-Scissors game,
RockPaperScissors.py program, ,
Rosette4.py program,
Rosette6.py program, , ,
RosetteGoneWild.py program, , ,
Rosette.py program, ,
RosettesAndPolygons.py program, , , ,
rotations,
round() function, ,
RubberBandBall.py program, ,
running programs,
S
SayMyName.py program, ,
SayOurNames.py program, ,
scale() function,
score
adding points,
displaying in game,
subtracting lives,
screenshots,
self parameter,
set_caption() function,
setheading() function,
set_mode() function, , ,
setpos() function, , , , ,
setx() function,
sety() function,
shell, , ,
defined, ,
doing math in, ,
syntax errors, ,
variables in, ,
ShowDot.py program, , ,
ShowPic.py program, ,
sides variable, , , ,
single quotation marks ('),
size variable,
SmileyBounce1.py program, , ,
SmileyBounce2.py program, , ,
Smiley class,
SmileyExplosion.py program, , ,
SmileyMove.py program,
SmileyPong1.py program, , , , ,
SmileyPong2.py program, , ,
SmileyPong3.py program,
SmileyPopHitCounter.py program,
SmileyPop.py program,
SmileyPop2.py program,
SmileyThrow.py program,
sorting, defined,
sort() function, ,
sound, adding with Pygame,
speed,
speed() function,
SpiralFamily.py program, , ,
spiral() function,
SpiralMyName.py program, , ,
SpiralRosettes.py program, ,
spot variable,
Sprite class,
sprites
defined,
removing,
scaling,
setting up,
updating,
square brackets ([]),
square spirals
adjusted,
basic,
SquareSpiral1.py program, ,
SquareSpiral2.py program, ,
SquareSpiral3.py program, ,
statements
defined,
syntax errors,
str() function, ,
strings, , ,
defined, , ,
subtraction operator (-), ,
SuperSpiral.py program, ,
surfaces,
symmetric ciphers (symmetric codes),
symmetry,
syntax
defined, ,
errors, ,
T
textinput() function, ,
text variable,
ThankYou.py program, ,
tick() method, ,
timer variable,
transformation, defined,
transparency, defined,
true division,
True value,
TurtleDrawMax.py program, ,
TurtleDraw.py program, , , ,
turtle graphics,
circles,
colors,
changing background,
using multiple,
defined,
multi-sided spirals,
Pygame vs.,
setting random positions,
square spirals
adjusted,
basic,
website,
turtle module,
(see also drawing; functions; loops; randomness)
circle() function,
forward() function,
listen() function,
numinput() function, , ,
onkeypress() function,
onscreenclick() function, , , ,
pendown() function,
penup() function,
setpos() function,
textinput() function, ,
window_height() function,
window_width() function,
write() function,
turtlesize() function,
typefaces (fonts),
U
update() function, , , , , , ,
up() function,
upper() function, ,
V
values,
variables,
(see also names of specific variables)
assigning values to,
defined, , ,
naming,
order of operations,
in shell, ,
true division,
ViralFamilySpiral.py program,
ViralSpiral.py program, , ,
W
War-style card game,
building deck of cards,
continuing play,
counting cards,
dealing cards,
weight_lb variable,
WhatsMyGrade.py program,
WhatToWear.py program,
while loops, , , , , , , , ,
defined,
width() function, , ,
window_height() function, , ,
window_width() function, , ,
write() function,
X
x-axis, , ,
x variable, , ,
xvel parameter,
Y
Yahtzee-style game,
probabilities,
setting up,
sorting dice,
testing dice,
y-axis, , ,
your_age variable,
your_face variable, ,
YourName.py program, ,
your_name variable, ,
your_suit variable,
yvel parameter,