Index

!= operator

number not equal, 19, 34

overloading, 270

set not equal, 187, 188

string not equal, 23

** exponentiation operator, 17, 34

* operator

list repetition, 28

number multiplication, 16, 34

overloading, 270

in regular expression, 411, 413

string repetition, 24, 25

+= increment operator, 141

+ operator

list concatenation, 28

number addition, 16, 34

overloading, 270

in regular expression, 411, 413

string concatenation, 24, 25

- operator

negation unary operator, 34

overloading, 270

set difference, 187, 188

subtraction binary operator, 16, 34

.. parent folder, 111

. regular expression operator, 411, 413

// quotient operator, 17, 34

/ operator

number division, 16, 34

overloading, 270

= operator

number less than or equal, 19, 34

overloading, 270

SQL less than or equal, 435

subset of, 187, 188

≪≫ SQL not equal operator, 435

operator

number less than, 18, 34

overloading, 270

proper subset of, 187, 188

SQL less than, 435

string less than, 23

== operator

number equal, 19, 34

overloading, 270, 273, 274

set equal, 187, 188

string equal, 23

versus = assignment operator, 22

= SQL equal operator, 435

= assignment statement, 12, 2022, 7579

and mutability, 7778

multiple assignment, 79

simultaneous assignment, 79

swapping, 7879

versus == equal operator, 22

>= operator

number greater than or equal, 19, 34

overloading, 270

SQL greater than or equal, 435

superset of, 187, 188

> operator

number greater than, 18, 34

overloading, 270

proper superset of, 187, 188

SQL greater than, 435

string greater than, 23

>>> prompt, 9, 16

? regular expression operator, 411, 413

[] operator

dictionary indexing, 175

list indexing, 27, 28

list slicing, 99

overloading, 287

in regular expression, 411, 413

string indexing, 2527

string slicing, 9899

tuple indexing, 182

two-dimensional list indexing, 147

% remainder operator, 17, 34

& set intersection operator, 187, 188

^ operator

in regular expression, 412, 413

set symmetric difference, 187, 188

| operator

in regular expression, 412, 413

set union, 187, 188

abs() built-in function, 17, 34

absolute pathname, 110

abstraction, 3, 10

accumulator

for integer sum, 141

for integer product, 142

for list concatenation, 142

loop pattern, see iteration pattern

for string concatenation, 142

acronym() function, 142

_ _add_ _() method, 269

add() set method, 188

algebraic

expression, 1618

operators, 16, 17, 34

algorithm, 3, 11

running time, see run time analysis

alignment in formatted output, 107

American Standard Code for Information Interchange (ASCII), 190191

analyze() function, 416, 420422

anchor, see HTML

and Boolean operator, 19, 20

Animal class, 259, 280

append() list method, 30

Application Programming Interface (API), 7

approxE() function, 152

approxPi() function, 196

Ariane rocket accident, 232

ARPANET, 6

assignment, see = assignment statement

attribute

class, see class

of HTML element, see HTML

instance, see instance

module, see module

automatic indexer, see web crawler

automation, 3

average.py program, 70

background widget option, 311, 314

backslash in file path, 111

base case, see recursion

before0() function, 156

Berners-Lee, Tim, 396, 397

BETWEEN SQL operator, 435

bgcolor() Screen method, 45

binary operator, 20

binary search, 374

bind() widget method, 324329

binding, see event

Bird class, 279, 280

blackjack application, 198202

blackjack() function, 202

bool Boolean type, see Boolean

George Boole, 20

Boolean

algebra, 20

expression, 1820

mutability, 76

operators, 19

type, 18

values, 18

borderwidth widget option, 311, 314

bot, see web crawler

break statement, 155156

browser, see web

bubblesort() function, 145

buffer overflow attack, 222

bug, see computer bug

builtins module, 238

bus, 5

Button tkinter class, 317320

command option, 318

event handler, 318

bye() Screen method, 45

bytes built-in type, 194, 404

Calc class, 337341

calc.py module, 337341

camelCase, 22

canonical string representation, 272274

Canvas tkinter class, 326331

capitalize() string method, 100, 102

Card class, 262263

ceil() math module function, 40

central processing unit (CPU), 4, 455

character encoding, 189194

ASCII, 190191

of files, 194

Unicode, 191194

UTF encodings, 193194

cheers() recursive function, 356

choice() random module function, 197

chr() built-in function, 191

circle() Turtle method, 43, 44

cities() function, 154

cities2() function, 154

class, 33, 38

attribute, 242244

attribute inheritance, 256257

attribute search, 280281

code reuse, 276

constructor, 36

constructor and repr() contract, 272276

default constructor, 261262

defining new class, 252287

defining new container, 263268

documentation, 258

enabling iteration, 289292

extending a method, 282

inheritance, 276284

inheritance patterns, 282283

method implementation, 243244

namespace, 242244, 253254

overloaded constructor, 260262

overloaded indexing operator, 287289

overloaded operator, 268276

overriding a method, 279282

subclass, 278

superclass, 278

class statement, 255, 257, 279

clear() set method, 188

clearscreen() Screen method, 45

ClickIt class, 332

clickit.py module, 318, 319, 331

client, see web

clock rate, 454

close() file method, 112, 114

close() Connection method, 442

code point (Unicode), 191

code reuse

with classes, 276

with functions, 216

Collector class, 409

column grid() method option, 316

column formatted output, 106

columnspan grid() method option, 316

command Button widget option, 318

command line, 55

comment, 73

commit() Connection method, 442

compareHands() function, 202

comparison operators, 34

for numbers, 1819

for sets, 188

for strings, 23

compiler, 7

complete() function, 179

computational thinking, 913

computer applications, 2

computer bug, 7

computer science, 24, 13

computer system, 37

computer virus, see virus

concatenation, see + operator

concurrent, 455

condition

in multiway if statement, 134137

in one-way if statement, 61, 134

in two-way if statement, 64, 134

in while loop statement, 149

mutually exclusive, 136

connect() sqlite3 function, 441

Connection sqlite3 class, 441

method close(), 442

method commit(), 442

method cursor(), 441

constructor, see class

container class, see class

continue statement, 156157

core (CPU), 454

cos() math module function, 40

count() list method, 30

count() string method, 100, 102

COUNT() SQL function, 436

countdown() recursive function, 352354

counter loop pattern, see iteration pattern

counting operations, 368

cpu_count() multiprocessing function, 454

crawl1() function, 416

crawl2() function, 419

crawling, see web

CREATE TABLE SQL statement, 439

create_line() widget method, 327, 328

create_rectangle() widget method, 328

create_oval() widget method, 328

cross join, see SQL

crosscheck.py module, 459460

current working directory, 110

cursor, 113

Cursor sqlite3 class, 441

as an iterator, 443

method execute(), 441

method fetchall(), 443, 444

cursor() Connection method, 441

data type, 1112

database, 430445

column, 431

engine, 432, 440

file, 430, 431

management system, 432

programming, 440

record, 431

row, 431

SQLite, 440

SQLite command-line shell, 433

sqlite3 module, 440445

structured data storage, 431

table, 431

Day class, 334

day.py module, 321, 322, 333

dealCard() function, 200

debugger, 7

decimal precision in formatted output, 107

decision structure, see if statement

Deck class, 264266

decode() bytes method, 194, 404

def function definition statement, 70

default constructor, see class

default exception handler, see exception

delete() widget method, 328

for Entry, 321

for Text, 323

delimiter for method split(), 100

depth-first traversal, 418422

DESC SQL clause, 435

developer, 24

dict dictionary type, see dictionary

dictionary, 172181

for counting, 179181

dict() constructor, 174

key-value pair, 173

methods, 176178

multiway condition substitute, 178

mutability, 174

operators, 175176

user-defined indexes, 172173

view object, 178

dictionary order (strings), 24, 193

directory, 110

Disk class, 381385

DISTINCT SQL clause, 433

divisors() function, 142

docstring, 73

multiline, 84

documentation, 73, 258

dot() Turtle method, 43, 44

double quotes, see string

Draw class, 336

draw.py module, 327, 328, 335

drawKoch() function, 362

dynamic.py module, 72

e math module Euler constant e, 40

editor, 54, 56

elif statement, see if statement

else clause, see if statement

emoticon, 43

emoticon() function, 83, 216

EmptyQueueError exception class, 286

encapsulation

with classes, 292

with functions, 217

with user-defined exceptions, 284, 286

end argument, see print()

Entry tkinter class, 320322

deleting entry, 321

reading entry, 321

epoch, 123

_ _eq_ _() method, 273, 275

_ _len_ _() method, 275

error, see exception

escape sequence, 97

, 96

, 96

, 97, 114

interpreted by print(), 97

in regular expressions, 413

eval() built-in function, 58

event, 319

binding to event handler, 324329

handler, 318, 319, 324, 337341

loop, 319

pattern, 324329

type, 324

Event tkinter class, 324326

attributes, 324

except statement, see exception

exception, 118121, 227

catching a type of, 230

catching and handling, 228235

default handler, 227, 230, 233

defining new, 284287

exceptional control flow, 227235

handler, 229, 230, 234

multiple handlers, 231

object, 120

raising, 227

raising in a program, 285

try/except statements, 229230

type, 120

Exception class, 286

execute() Cursor method, 441

execution control structure, 1213

decision, 5964, 134137

iteration, 6469, 137157

expand pack() method option, 314

experimental run time analysis, 370373

expression

algebraic, see algebraic

Boolean, see Boolean

evaluation, 17

Extender class, 282

factorial()

iterative function, 142

recursive function, 356

False value, 18

feed() HTMLParser method, 406

fetchall() Cursor method, 443, 444

fibonacci() function, 152

Fibonacci numbers, 151, 369

field width in formatted output, 107

file, 109118

appending to, 112, 122

binary, 109, 112, 404

character encoding, 194

closing, 117

cursor, 113

database, 430

flushing output, 118

logging access, 121125

mode, 112

opening, 111113

reading, 112117

reading and writing, 112

reading patterns, 114117

storage, 5

text, 109, 112

writing, 112, 117118

filesystem, 109111

absolute pathname, 110

current working directory, 110

directory, 110

folder, 110

pathname, 110

recursive structure, 365

relative pathname, 110

root directory, 110

tree structure, 110

fill pack() method option, 314

find() string method, 99, 102

findall() re function, 414

First-In First Out (FIFO), 266

float type, see floating point

floating point

float() constructor, 36

mutability, 76

type, 16

values, 16, 33

floor() math module function, 40

flowchart, 54

one-way if statement, 60, 61

three-way if statement, 135

two-way if statement, 63

while loop statement, 149

flushing output, 118

folder, 110

font widget option, 311

for loop statement, 6467, 137

iteration patterns, 137149

loop variable, 66

foreground widget option, 311, 314

format() string method, 104109

format string, 104

for time, 124

formatted output, 102109

forward() Turtle method, 42, 43

forward slash in file path, 111

fractal, 360364

Koch curve, 360

snowflake, 363

Fraction fractions class, 40

difference between float and, 41

fractions Standard Library module, 4041

Frame tkinter class, 329331

frequency() function, 181

frequent() function, 379

from module import keyword, 241

function

built-in math, 17

call, 29

code reuse, 216

encapsulation, 217

local variable, 217219

modifying global variable inside, 226

modularity, 217

recursive, see recursion

user-defined, 6975

functional language, 447

list comprehension, 445447

games of chance, 198202

geometry (of GUI), see widget

get() dictionary method, 177

get() widget method

for Entry, 321

for Text, 323

getheaders() HTTPResponse method, 404

_ _getitem_ _() method, 288

getpid() os function, 456

getSource() function, 405

geturl() HTTPResponse method, 404

getWordsFromFile() function, 452

global keyword, 226

global scope, 223227

global variable, 223

storing state in, 328

gmtime() time function, 124

Google, 447

goto() Turtle method, 43, 44

graphical user interface (GUI)

development, 310341

history, 320

object-oriented approach, 331341

graphics interchange format (GIF), 312

grid() widget method, 315317

GROUP BY SQL clause, 436

growthrates() function, 109

handle_data() HTMLParser method, 406

handle_endtag() HTMLParser method, 406

handler

exception, see exception

GUI event, see event

HTML document parser, 406

handle_starttag() HTMLParser method, 406

hanoi() recursive function, 380383

hard drive, 5

hardware, 4

height widget option, 311, 312

hello() function, 71, 74

hello.py module, 54

hello2() function, 153

help() built-in function, 38

higher-order programming, 371

HTML, 399403

a anchor element, 401

absolute hyperlink, 402

body element, 401

document parsing, 405408

document tree structure, 401

element, 400401

element attribute, 401, 402

head element, 401

heading element, 400

href attribute, 402

html element, 401

hyperlink, 396, 401, 409

relative hyperlink, 402

resources, 403

tag, 400

title element, 401

HTMLParser html.parser class, 405

html.parser Standard Library module, 405408

HTTP, 398399

hyperlink, see HTML

http.client Standard Library module, 403

HTTPResponse http.client class, 403

hyperlink, see HTML

HyperText Markup Language, see HTML

HyperText Transfer Protocol, see HTTP

IDLE, 8

editor, 54

running program, 54

if statement

elif statement, 134

else clause, 62, 134

multiway, 134137

one-way, 5962, 134

ordering of conditions, 136137

two-way, 6264, 134

ignore0() function, 157

image widget option, 311, 312

immutable, 29, 76

parameter passing, 8081

import statement, see module, 56

ImportError exception, 237

in operator

for dictionaries, 175

for lists, 28

for sets, 187, 188

for strings, 24, 25

incr2D() function, 148

incrementing, see += increment operator

indentation, 62

indented block

in class definition, 255, 257

in for loop statement, 67

in function definition, 70

in multiway if statement, 134

in one-way if statement, 61, 134

in two-way if statement, 64, 134

in while loop statement, 149

index, 25

in two-dimensional list, 147

IndexError exception, 119, 120

indexing operator, see [] operator

infinite loop pattern, see iteration pattern

inheritance, 276284

extending a method, 282

by objects, 256257

overriding a method, 282

patterns, 282283

subclass, 278

superclass, 278

Inheritor class, 282

_ _init_ _() method, 261262, 267

input() built-in function, 57

input.py module, 57

insert() list method, 30

insert() widget method

for Entry, 321

for Text, 323

INSERT INTO SQL statement, 439

instance

attribute, 257

variable, 255256

int integer type, see integer

integer

int() constructor, 36

mutability, 76

type, 16

values, 16, 33

integrated development environment (IDE), 7, 8, 54, 56

interactive shell, 8

restarting, 54

interest() function, 150

Internet, 6

interpreter, 7, 17

inverted index, 451453

IOError exception, 121

items() dictionary method, 177, 184

_ _iter_ _() method, 290

iteration

implementation in new classes, 289292

through indexes of a list, 138140

through integers in a range, 6869, 138

through a list, 66, 137

through a string, 65, 137

iteration pattern

accumulator loop, 140143

counter loop, 138140

infinite loop, 153

iteration loop, 137138

loop and a half, 153155

nested loop, 143145, 147149

sequence loop, 151152

iteration structure

for loop, see for loop statement

while loop, see while loop statement

iterator, 290

jump() function, 82, 216

key-value pair

dictionary, 173

MapReduce, 447

KeyboardInterupt exception, 120

KeyError exception, 174

keyLogger.py module, 325

keys() dictionary method, 176, 177

keyword (reserved), 23

koch() recursive function, 361

Koch curve, 360364

kthsmallest() function, 378

Label tkinter class, 310316

for images, 312315

for text, 310311

language

HTML, 397

SQL, 432

left() Turtle method, 42, 43

left-to-right, 35

left-to-right evaluation, 16

len() built-in function

for dictionaries, 175

for lists, 28

for sets, 187

for strings, 25

overloading, 270, 275

lexicographic order, 193

library, 7

line ending in text file, 114

linear search, 374

LinkParser class, 407

Linux, 6

list, 2731

comprehension, 445447

concatenation, see + operator

indexing, see [] operator

length, see len() built-in function

list() constructor, 36

methods, 2931

mutability, 29, 76, 77

operators, 2729

repetition, see * operator

slicing, see [] operator

two-dimensional, 146149

type, 27

value, 27

listdir() os module function, 366

local scope, 223224

local variable, 217219

localtime() time function, 124

log() math module function, 40

log file, 121

logging, 121125

motivation, 122

loop and a half pattern, see iteration pattern

lower() string method, 102

Mac OS X, 5

_ _main_ _ module, 238

main memory, 4

mainloop() widget method, 310

maketrans() string method, 101

map() Pool method, 455

map MapReduce function, 450

MapReduce class, 458

MapReduce, 447453, 458461

inverted index, 451453

name cross-checking, 459

sequential versus parallel, 460

word frequency, 447450

master (widget), see widget

match object (regular expression), 415

math Standard Library module, 3940

max() built-in function, 18, 28

method, 30, 31

call, 38

extending, 282

as a function in a namespace, 243244

inheriting, 282

overriding, 279282

Microsoft Windows, 5

min() built-in function, 18, 28

mode, see file mode

model, 3, 10

modularity

through classes, 293

through functions, 217

module, 39, 56, 235242

attribute, 235236

current working directory, 110

importing, 39, 235242

importing all attributes, 241

importing module name, 240

importing some attributes, 240

_ _main_ _ module, 238

_ _name_ _ variable, 238240

namespace, 236242

search path, 236, 239

top-level, 238240

user-defined, 56

Moore's Law, 454

move() widget method, 328

multiple assignment, 79

multiprocessing Standard Library module, 454461

class Pool, 454461

function cpu_count(), 454

multiway, see if statement

mutable, 29, 76

parameter passing, 8182

mutually exclusive conditions, 136

MyList class, 277

_ _name_ _ variable, 238240

NameError exception, 119, 120

namespace, 219

class, 253254

function call, 218219

global, 223227

local, 224

module, 236242

object, 254

and the program stack, 219223

negative index, 26, 27

nested() function, 144

nested loop pattern, see iteration pattern

nested statements, 6768

nested2() function, 145

network, 5, 6

_ _next_ _() method, 290

not Boolean operator, 19, 20

numChars() function, 114

numLines() function, 116

numWords() function, 115

object, 31

class attributes inheritance, 256257

instance variable, 255256

namespace, 254

type, 32

value, 32, 33

object-oriented programming (OOP), 38, 252292

GUI development, 331341

Python, 32

occurrences

most frequently occurring item, 379

number of, 179181, 420

using MapReduce, 447450

one-way, see if statement

oneWay.py module, 60

oneWay2.py module, 61

open() built-in function, 111113, 194

openLog() function, 121, 125

open source, 6

operating system, 56

operator, 31

algebraic, see algebraic

Boolean, see Boolean

as class method, 269270

dictionary, see dictionary

as a function in a namespace, 270

list, see list

overloaded, see class

precedence, see precedence rule

regular expression, 411415

set, see set

string, see string

or Boolean operator, 19, 20

ord() built-in function, 190

ORDER BY SQL clause, 435

os Standard Library module, 366

getpid() function, 456

listdir() function, 366

path.join() function, 366

OverflowError exception, 33, 120

overloaded, see class

overriding a method, 279281

pack() widget method, 311, 313315

packing widgets, see widget

padx, pady widget options, 311, 314

parallel.py module, 455

parallel computing, 453461

versus concurrent, 455

speedup, 457

parallel2.py module, 456

parameter passing, 7982

immutable parameter, 8081

mutable parameter, 8182

passing functions, 371

parameter substitution (SQL), 441

parent folder, 111

parser, 118

HTML document, see HTML

partition() MapReduce function, 449

pass statement, 121, 157

path sys module variable, 239

pathsys module variable, 236

path.join() os module function, 366

pathname, 110

absolute, 110

relative, 110

pattern() recursive function, 358

peace.py module, 312

Peg class, 381385

pencolor() Turtle method, 43

pendown() Turtle method, 43, 44

pensize() Turtle method, 43, 44

penup() Turtle method, 43, 44

perimeter.py program, 70

phone.py module, 315

PhotoImage tkinter class, 312

pi math module constant π, 40

placeholder

in format string, 104

in SQL query, 442

plotter.py module, 329

Point class, 252258, 260262

constructor and repr() contract, 272274

implementation, 254255

methods, 252

overloaded operators, 268

string representation, 270272

Pool multiprocessing class, 454461

method map(), 455

pop() method

dictionary, 176, 177

list, 30

precedence rule, 16, 18, 35

primeDensity.py module, 457

print() built-in function, 54, 56, 102104

end argument, 103

sep argument, 102

versus return statement, 71

print2D() function, 147

process, 454

ID, 456

program, 2, 3, 54

editing, 54

executing, 54, 55

program stack, 219223

buffer overflow attack, 222

stack frame, 221

programming, 7

language, 7

Project Gutenberg, 460

prompt

input() function, 57

Python shell, see >>> prompt

protocol, 397

HTTP, see HTTP

pseudocode, 11

pseudorandom number generator, 194

Python

background, 8

Standard Library, see Standard Library modules

Queue class, 266268, 284, 287, 288

empty queue exception, 286

enabling iteration, 290292

overloaded operators, 269, 274276

as subclass of list, 283

Queue2 class, 283

QueueIterator class, 291

quotes, see string

raise() built-in function, 285

raising exception, see exception

random Standard Library module, 194198

random access memory (RAM), see main memory

randomness, 196

randrange() random module function, 195

range() built-in function, 6869

in counter loop pattern, 138

re Standard Library module, 414415

read() file method, 112, 113

read() HTTPResponse method, 404

readline() file method, 112, 113

readlines() file method, 112, 116

real numbers, 33

recursion, 352385

base case, 353

depth-first traversal, 418422

filesystem traversal, 364367

fractal, 360364

function, 352

and the program stack, 356357

recursive call, 352

recursive step, 354

recursive thinking, 352, 354356

repeated recursive calls, 362

stopping condition, 353

virus scanning, 364367

web crawling, 416422

reduce MapReduce function, 450

regular expression, 411415

escape sequences, 413

operators, 411415

resources, 412

relational

algebra, 440

database, 440

relative pathname, 110

relief widget option, 311, 314

remove() method

for lists, 30

for sets, 188

replace() string method, 100, 102

Replacer class, 282

_ _repr_ _() method, 276

repr() built-in function, 271

contract with constructor, 272276

overloading, 270, 271, 275

reserved keywords, 23

result table, see SQL

return statement, 7072

versus print() built-in function, 71

reverse() list method, 30

reverse() recursive function, 356

reverse index, see inverted index

rfib() recursive function, 369

run time analysis, 372

right() Turtle method, 42, 43

rlookup() function, 175

root directory, 110

row grid() method option, 316

rowspan grid() method option, 316

rpower() recursive function, 367

run time analysis, 367373

experimental, 370373

linear versus binary search, 376

safe_open() function, 232

sample() random module function, 197

scalability, 445

scan() recursive function, 365

scientific notation, 33

scope, 223

Screen turtle module class

constructor, 42

methods, 45

search() recursive function, 375

search() re function, 415

search engine, 415

search of a list, 374379

binary, 374

duplicates, 377

linear, 374

linear versus binary, 376

search path, see module

SELECT SQL statement, 432434

selecting k th smallest, 378

sep argument, see print()

SeqMapReduce class, 450

sequence loop pattern, see iteration pattern

server, see web

set, 185189

comparison, 187

constructor, 186

for duplicate removal, 186

empty set, 186

methods, 188189

operators, 187188

setheading() Turtle method, 43, 45

setup (of Python IDE), 8

setx(), sety() Turtle methods, 43

shell, see interactive shell

shuffle() random module function, 197

shuffledDeck() function, 200

side pack() method option, 313

simultaneous assignment, 79

sin() math module function, 40

single quotes, see string

slicing, see [] operator

smileyPeace.py module, 313

snowflake fractal, 363

software, 4

software library, 7

sort() list method, 30

sorted() function, 140

speedup (parallel), 457, 460

spelling.py module, 65

split() string method, 100, 102

SQL, 432440

conditional operators, 435

COUNT() function, 436

CREATE TABLE statement, 439

cross join, 437

DESC clause, 435

DISTINCT clause, 433

GROUP BY clause, 436

INSERT INTO statement, 439

ORDER BY clause, 435

parameter substitution, 441

querying multiple tables, 437

resources, 440

result table, 432

SELECT statement, 432434

SQL injection, 442

SUM() function, 436

UPDATE statement, 439

WHERE clause, 434436

SQLite, 440

command-line shell, 433

sqlite3 Standard Library module, 440445

class Connection, 441

class Cursor, 441

function connect(), 441

sqrt() math module function, 39, 40

stack frame, see program stack

Standard Library modules, 39

fractions, see fractions

html.parser, see html.parser

http.client, see http.client

math, see math

multiprocessing, see multiprocessing

os, see os

random, see random

re, see re

sqlite3, see sqlite3

sys, see sys

time, see time

tkinter, see tkinter

turtle, see turtle

urllib.parse, see urllib.parse

urllib.request, see urllib.request

StopIteration exception, 291

str() string constructor

informal string representation, 272

overloading, 270

str string type, see string

strftime() time function, 124

string, 2327, 96102

comparison, 24, 192

concatenation, see + operator

encoding, see character encoding

formatting, 104109

methods, 99102

methods return copy, 100

mutability, 29, 76

operators, 2327

pattern matching, 411415

quotes, 23, 96

repetition, see * operator

representation, 9697

representation of object, 102, 271274

slicing, see [] operator

str() constructor, see str() constructor

triple quotes, 97

type, 23

value, 23

strip() string method, 102

structured data storage, see database

Structured Query Language, see SQL

subclass, 278

substring, 25

sum() built-in function, 28

SUM() SQL function, 436

superclass, 278

swapping, 7879

syntax error, 118

sys Standard Library module, 236, 239

table, see database

TCP/IP, 6

temperature() function, 135

Text tkinter class, 323326

text widget option, 311

text entry box

multiline, see Text tkinter class

single-line, see Entry tkinter class

time() time function, 123

time format directive, 124

time Standard Library module, 123125

timing() function, 371

timingAnalysis() function, 372

Tk tkinter class, 310

tkinter Standard Library module, 310

coordinate system, 330

resources, 317

widgets, see widget

top-level module, 238240

total() (Blackjack) function, 201

Tower of Hanoi problem, 379385

translate() string method, 101, 102

tree

filesystem, 110

of recursive calls, 373

root, 401

structure of HTML document, 401

triple quotes, 97

True value, 18

truth table, 20

try statement, see exception

tuple, 182185

as dictionary keys, 183184

mutability, 182

one-element tuple, 184

Turtle turtle class

constructor, 42

methods, 4245

turtle Standard Library module, 4145

Screen class, see Screen

Turtle class, see Turtle

Turtle graphics, 41, 360, 379

turtlefunctions.py module, 82

turtles() Screen method, 45

two-dimensional list, 146149

two-way, see if statement

twoWay.py module, 63

type, 1112, 31

in formatted output, 108

type() built-in function, 32

type conversion

explicit, 37

implicit, 17, 36

TypeError exception, 119, 120

unary operator, 20

undo() Turtle method, 43, 44

Unicode, 191194

uniform() random module function, 196

Uniform Resource Locator, see URL

uniqueness testing, 377

UNIX, 5

update() dictionary method, 176, 177

UPDATE SQL statement, 439

upper() string method, 100, 102

URL, 397398

absolute, 402

host, 397

pathname, 397

relative, 402

scheme, 397

urljoin() urllib.parse function, 409

urllib.request Standard Library module, 403405

urllib.parse Standard Library module, 408409

urlopen() urllib.request function, 403

user-defined

function, 6975

module, 56

user-defined indexes, see dictionary

UTC time, 123

UTF encodings, 193194

ValueError exception, 120

Van Rossum, Guido, 8

variable, 2021

evaluation of, 21

global, 223

instance, 255256

local, 217219

naming convention, 22

naming in Python 3, 22

naming rules, 2223

type, 32

unassigned, 21

vertical() recursive function, 354

view object, 178

virus, 364

scanner, 364367

signature, 364

web, 396

browser, 396, 399, 400

client, 396

crawler, 415422

page source file, 399

server, 396

server root directory, 397

WHERE SQL clause, 434436

while loop statement, 149151

iteration patterns, 151155

widget, 310

Button tkinter class, 317320

Canvas tkinter class, 326331

constructor options, 311316

coordinate system, 330

Entry tkinter class, 320322

Frame tkinter class, 329331

Label tkinter class, 310316

for images, 312315

for text, 310311

mainloop() widget method, 310

master, 311, 329

mixing pack() and grid(), 316

placement, 311

placement with Frame, 329331

placement with grid(), 315317

placement with pack(), 313315

Text tkinter class, 323326

Tk, 310

width widget option, 311, 312

wordcount() function, 181

World Wide Web, see WWW

wrapper function, 122

write() file method, 112, 117

WWW, 6, 396403

history, 396

HTML, see HTML

HTTP, see HTTP

locator scheme, 397

naming scheme, 397

Python web API, 403411

technologies, 397

URL, see URL

ZeroDivisionError exception, 119, 120

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset