Python Programming: An Introduction to Computer Science

(Nora) #1
246 INDEX

signature(interface), 148
toreduceduplication, 88
functiondefinition, 88
functions
built-in
chr, 46
cmp, 203
eval, 49
float, 37
int, 37
len, 43
long, 37
max, 118
open, 56
ord, 46
range, 32
rawinput, 42
read, 56
readline, 56
readlines, 56
round, 37
str, 52
type, 28
write, 57
compareItems, 203
distance, 96
drawBar, 91
gameOver, 152
getInputs, 148
getNumbers, 187
happy, 89
main, 7
whyuse, 9
mathlibrary,seemathlibrary, functions
mean, 188
median, 189
merge, 239
mergeSort, 240
moveTower, 244
randomlibrary,seerandomlibrary, functions
recursive binarysearch, 237
recursive factorial, 236
selsort, 238
simNGames, 150
simOneGame, 152
singFred, 89
singLucy, 89
square, 95
stdDev, 188
stringlibrary,seestringlibrary
futurevalue
algorithm, 23
problemdescription, 23
program,24, 99


programspecification, 23
futurevaluegraph
finalalgorithm, 73
problem, 70
program,74,76,87, 91
roughalgorithm, 71
futval.py, 24
futvalgraph.py, 74
futvalgraph2.py, 76, 87
futvalgraph3.py, 91
futvalgraph4.py, 99

gameOver, 152
GCD(GreatestCommonDivisor), 140
getAnchor, 83
getCenter, 82, 83
getInputs, 148
getMouse,78, 81
exampleuse, 78
getNumbers, 187
getP1,82, 83
getP2,82, 83
getPoints, 83
getRadius, 82
getText, 83
getX, 82
getY, 82
goofy.py, 247
gozinta, 29
graphicslibrary, 64,81–84
drawingexample, 66
genericmethodssummary, 82
graphicalobjects,82–83
methods
forText, 83
clone, 70
forCircle, 82
forEntry, 83
forImage, 83
forLine, 82
forOval, 83
forPoint, 82
forPolygon, 83
forRectangle, 82
getMouse, 78
move, 68
setCoords, 75
objects
Circle, 82
Entry, 79, 83
GraphWin,64, 81
Image, 83
Line, 82
Oval, 83
Free download pdf