Index_P


P

packages, defined, 338

parameters

column, grid() method, 318

columnspan, grid() method, 318

default parameter values, 174, 176–178

height, 320

positional

defined, 174

keyword arguments and, 176

positional arguments and, 175–176

receiving information through, 170

row, grid() method, 318

sticky, grid() method, 319

width, 320

wrap, 320

Password program example, 57–59

passwords, reveal() method, 319

pickling, 209–213

pixels, 342

Pizza Panic program example, 338–339

Pizza Slicer program example, 109–110

planned programs, 83–84

platform independence, 5

play() method, 390, 431

playing

music, 391

sound, 389–390

Playing Cards program example, 264–268

play_music() function, 431

polymorphism, 280

pop() function, 138

populate() method, 290

positional parameters

defined, 174

keyword arguments and, 176

positional arguments and, 175–176

positive position numbers, 101

print command, 9

printing

objects, 239

tuples, 115–116

private attributes, 248

accessing, 245–246

creating, 245

defined, 244

Private Critter program example, 244

private methods, 248

accessing, 247–248

creating, 246–247

defined, 244

programmer-defined functions, 168

programming, event-driven, 302–304

programs. See also code, 19

Alien Blaster, 261–263

Astrocrash game, 378

asteroids, 394–397

collisions, handling, 407–410

explosions, 410–414

game assets, 394

game classes, 394

game features, 393

missiles, firing, 402–407

ship movement, 399–402

ship rotation, 397–399

Attribute Critter, 235–237

Background Image, 344–345

Big Score, 346–348

Birthday Wishes, 174–175

Blackjack

additional_cards() method, 295

BJ_Card class, 290

BJ_Dealer class, 293–294

BJ_Deck class, 290–291

BJ_Game class, 294

BJ_Hand class, 291–292

BJ_Player class, 293

bust() method, 295

cards module, 285–287

classes, types of, 287

games module, 289

init() method, 294

instructions, 260

main() function, 297

play() method, 296–297

still_playing property, 295

Click Counter, 314–316

Constructor Critter, 233–234

Counter program example, 94–95

Craps Roller program, 55

Critter Caretaker

Constructor method, 253–254

Critter class, 253

eat() method, 255

main() function, 256

menu system, creating, 256–257

mood property, 254–255

overview, 228–229

_pass_time() method, 254

play() method, 255–256

talk() method, 255

Exclusive Network, 78–80

Fancy Credits, 22

Finicky Counter, 75–76

Game Over, 2

Game Over 2.0, 18–19

Geek Translator, 147

Global Reach, 179–180

Granted or Denied, 61–62

Greeter program, 33, 36

Guess My Number game

congratulating players, 88

description of, 54

game exit, 88

game explanation, 87

guessing loop, creating, 87–88

initial comment block, creating, 86–87

initial values, setting, 87

program plan, 85–86

random numbers, 87

GUI program, 304–306

Handle It, 214

Hangman, 128–129

constants, creating, 156–159

end of game, 161

player's guesses, 160

program setup, 155–156

variables, initializing, 159

wrong letters guessed, 160

Hero's Inventory, 113–114

High Scores, 134–135

Instructions, 165–167

Labeler, 307–308

Lazy Buttons, 309–310

Longevity, 316–317

Loopy String, 93

Losing Battle, 70–71

Mad Lib, 300–301

create_widgets() method, 330–332

tell_story() method, 333–334

Tkinter module, 330

Maitre D', 73–74

Message Analyzer, 98

Mood Computer, 63–66

Movie Chooser, 322–324

Moving Pan, 361–363

No Vowels, 105–106

Password, 57–59

Pizza Panic, 338–339

Pizza Slicer, 109–110

planning, 83–84

Playing Cards, 264–268

Private Critter, 244

Quotation Manipulation, 38–39

Random Access, 100–101

Read It, 199–201

Read Key, 379–382

Receive and Return, 169–170

Rotate Sprite, 383

saving, 11

Silly Strings, 26

Simple Game, 281

Three-Year-Old Simulator, 67–68

Tic-Tac-Toe

ask_number() function, 187

ask_yes_no() function, 187

computer_move() function, 191–193

congrat_winner() function, 194

data representation, 184

display_board() function, 188

display_instruct() function, 186–187

functions, creating list of, 184

human_move() function, 190–191

legal_moves() function, 189

main() function, 194

new_board() function, 188

next_turn() function, 194

overview, 164

pieces() function, 187–188

program setup, 186

pseudocode, writing, 183

winner() function, 189–190

tracing, 71–72

Trivia Challenge

answers, checking and retrieving, 223–224

data file layout, 219–220

game ending, 224

game setup, 222–223

next_block() function, 221–222

next_line() function, 221

open_file() function, 220–221

overview, 198

questions, asking, 223

Useless Trivia, 18

Word Jumble game, 92

congratulations, 124

empty jumble string, 122

end of game, 124

loops, setting up, 122

player's guesses, 124

program setup, 121

welcoming players, 123

Word Problems, 28–30

properties, defined, 249

property() function, 251–252

pseudocode

algorithms, 84

Tic-Tac-Toe game example, 183

pseudorandom numbers, 54

public attributes, 244

public methods, 244

pygame modules, 338–339

Python

installing, 6

overview, 3–5

Tutor mailing list, 5

Web site, 6–7




Python Programming for the Absolute Beginner
Python Programming for the Absolute Beginner, 3rd Edition
ISBN: 1435455002
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net