Introduction to Computing Using Python
Subtitle: An Application Development Focus
Publisher: Wiley & Sons, Limited, John
Published: 2012
Language: eng
Number of pages: 512
ISBN-13: 9780470618462
Subjects: Brokers; Electronic trading of securities
Table of contents: title: Preface
pagenum: xvii; label: 1
title: Introduction to Computer Science
pagenum: 1; label: 1.1
title: Computer Science
pagenum: 2; title: What Do Computing Professionals Do?
pagenum: 2; title: Models, Algorithms, and Programs
pagenum: 3; title: Tools of the Trade
pagenum: 3; title: What Is Computer Science?
pagenum: 4; label: 1.2
title: Computer Systems
pagenum: 4; title: Computer Hardware
pagenum: 4; title: Operating Systems
pagenum: 5; title: Networks and Network Protocols
pagenum: 6; title: Programming Languages
pagenum: 7; title: Software Libraries
pagenum: 7; label: 1.3
title: Python Programming Language
pagenum: 8; title: Short History of Python
pagenum: 8; title: Setting Up the Python Development Environment
pagenum: 8; label: 1.4
title: Computational Thinking
pagenum: 9; title: A Sample Problem
pagenum: 9; title: Abstraction and Modeling
pagenum: 10; title: Algorithm
pagenum: 10; title: Data Types
pagenum: 11; title: Assignments and Execution Control Structures
pagenum: 12; title: Chapter Summary
pagenum: 13; label: 2
title: Python Data Types
pagenum: 15; label: 2.1
title: Expressions, Variables, and Assignments
pagenum: 16; title: Algebraic Expressions and Functions
pagenum: 16; title: Boolean Expressions and Operators
pagenum: 18; title: Variables and Assignments
pagenum: 20; title: Variable Names
pagenum: 22; label: 2.2
title: Strings
pagenum: 23; title: String Operators
pagenum: 23; title: Indexing Operator
pagenum: 25; label: 2.3
title: Lists
pagenum: 27; title: List Operators
pagenum: 27; title: Lists Are Mutable, Strings Are Not
pagenum: 29; title: List Methods
pagenum: 29; label: 2.4
title: Objects and Classes
pagenum: 31; title: Object Type
pagenum: 32; title: Valid Values for Number Types
pagenum: 33; title: Operators for Number Types
pagenum: 34; title: Creating Objects
pagenum: 35; title: Implicit Type Conversions
pagenum: 36; title: Explicit Type Conversions
pagenum: 37; title: Class Methods and Object-Oriented Programming
pagenum: 38; label: 2.5
title: Python Standard Library
pagenum: 39; title: Module math
pagenum: 39; title: Module fractions
pagenum: 40; label: 2.6
title: Case Study: Turtle Graphics Objects
pagenum: 41; title: Chapter Summary
pagenum: 45; title: Solutions to Practice Problems
pagenum: 46; title: Exercises
pagenum: 48; label: 3
title: Imperative Programming
pagenum: 53; label: 3.1
title: Python Programs
pagenum: 54; title: Our First Python Program
pagenum: 54; title: Python Modules
pagenum: 56; title: Built-In Function print()
pagenum: 56; title: Interactive Input with input()
pagenum: 57; title: Function eval()
pagenum: 58; label: 3.2
title: Execution Control Structures
pagenum: 59; title: One-Way Decisions
pagenum: 59; title: Two-Way Decisions
pagenum: 62; title: Iteration Structures
pagenum: 64; title: Nesting Control Flow Structures
pagenum: 67; title: Function range()
pagenum: 68; label: 3.3
title: User-Defined Functions
pagenum: 69; title: Our First Function
pagenum: 69; title: print() versus return
pagenum: 71; title: Function Definitions Are "Assignment" Statements
pagenum: 72; title: Comments
pagenum: 73; title: Docstrings
pagenum: 73; label: 3.4
title: Python Variables and Assignments
pagenum: 75; title: Mutable and Immutable Types
pagenum: 76; title: Assignments and Mutability
pagenum: 77; title: Swapping
pagenum: 78; label: 3.5
title: Parameter Passing
pagenum: 79; title: Immutable Parameter Passing
pagenum: 80; title: Mutable Parameter Passing
pagenum: 81; label: 3.6
title: Case Study: Automating Turtle Graphics
pagenum: 82; title: Chapter Summary
pagenum: 84; title: Solutions to Practice Problems
pagenum: 85; title: Exercises
pagenum: 88; title: Problems
pagenum: 88; label: 4
title: Text Data, Files, and Exceptions
pagenum: 95; label: 4.1
title: Strings, Revisited
pagenum: 96; title: String Representations
pagenum: 96; title: The Indexing Operator, Revisited
pagenum: 98; title: String Methods
pagenum: 99; label: 4.2
title: Formatted Output
pagenum: 102; title: Function print()
pagenum: 102; title: String Method format()
pagenum: 104; title: Lining Up Data in Columns
pagenum: 106; label: 4.3
title: Files
pagenum: 109; title: File System
pagenum: 109; title: Opening and Closing a File
pagenum: 111; title: Patterns for Reading a Text File
pagenum: 114; title: Writing to a Text File
pagenum: 117; label: 4.4
title: Errors and Exceptions
pagenum: 118; title: Syntax Errors
pagenum: 118; title: Built-In Exceptions
pagenum: 119; label: 4.5
title: Case Study: Logging File Access
pagenum: 121; title: A Thin Wrapper Function
pagenum: 122; title: Logging File Names
pagenum: 122; title: Getting and Formatting the Date and Time
pagenum: 123; title: Final Implementation of openLog()
pagenum: 125; title: Chapter Summary
pagenum: 125; title: Solutions to Practice Problems
pagenum: 126; title: Exercises
pagenum: 128; title: Problems
pagenum: 130; label: 5
title: Execution Control Structures
pagenum: 133; label: 5.1
title: Decision Control and the if Statement
pagenum: 134; title: Three-Way (and More!) Decisions
pagenum: 134; title: Ordering of Conditions
pagenum: 136; label: 5.2
title: for Loop and Iteration Patterns
pagenum: 137; title: Loop Pattern: Iteration Loop
pagenum: 137; title: Loop Pattern: Counter Loop
pagenum: 138; title: Loop Pattern: Accumulator Loop
pagenum: 140; title: Accumulating Different Types
pagenum: 141; title: Loop Patterns: Nested Loop
pagenum: 143; label: 5.3
title: More on Lists: Two-Dimensional Lists
pagenum: 145; title: Two-Dimensional Lists
pagenum: 146; title: Two-Dimensional Lists and the Nested Loop Pattern
pagenum: 147; label: 5.4
title: while Loop
pagenum: 149; label: 5.5
title: More Loop Patterns
pagenum: 151; title: Iteration Patterns: Sequence Loop
pagenum: 151; title: Loop Pattern: Infinite Loop
pagenum: 153; title: Loop Pattern: Loop and a Half
pagenum: 153; label: 5.6
title: Additional Iteration Control Statements
pagenum: 155; title: break Statement
pagenum: 155; title: continue Statement
pagenum: 156; title: pass Statement
pagenum: 157; title: Chapter Summary
pagenum: 157; title: Solutions to Practice Problems
pagenum: 158; title: Exercises
pagenum: 161; title: Problems
pagenum: 163; label: 6
title: Containers and Randomness
pagenum: 171; label: 6.1
title: Dictionaries
pagenum: 172; title: User-Defined Indexes as Motivation for Dictionaries
pagenum: 172; title: Dictionary Class Properties
pagenum: 173; title: Dictionary Operators
pagenum: 175; title: Dictionary Methods
pagenum: 176; title: A Dictionary as a Substitute for Multiway Condition
pagenum: 178; title: Dictionary as a Collection of Counters
pagenum: 179; label: 6.2
title: Other Built-In Container Types
pagenum: 182; title: Class tuple
pagenum: 182; title: tuple Objects Can Be Dictionary Keys
pagenum: 183; title: Dictionary Method items(), Revisited
pagenum: 184; title: Class set
pagenum: 185; title: Using the set Constructor to Remove Duplicates
pagenum: 186; title: set Operators
pagenum: 187; title: set Methods
pagenum: 188; label: 6.3
title: Character Encodings and Strings
pagenum: 189; title: Character Encodings
pagenum: 189; title: ASCII
pagenum: 190; title: Unicode
pagenum: 191; title: UTF-8 Encoding for Unicode Characters
pagenum: 193; label: 6.4
title: Module random
pagenum: 194; title: Choosing a Random Integer
pagenum: 195; title: Choosing a Random "Real"
pagenum: 196; title: Shuffling, Choosing, and Sampling at Random
pagenum: 197; label: 6.5
title: Case Study: Games of Chance
pagenum: 198; title: Blackjack
pagenum: 198; title: Creating and Shuffling the Deck of Cards
pagenum: 199; title: Dealing a Card
pagenum: 200; title: Computing the Value of a Hand
pagenum: 200; title: Comparing the Player's and the House's Hands
pagenum: 201; title: Main Blackjack Function
pagenum: 202; title: Chapter Summary
pagenum: 203; title: Solutions to Practice Problems
pagenum: 203; title: Exercises
pagenum: 206; title: Problems
pagenum: 208; label: 7
title: Namespaces
pagenum: 215; label: 7.1
title: Encapsulation in Functions
pagenum: 216; title: Code Reuse
pagenum: 216; title: Modularity (or Procedural Decomposition)
pagenum: 217; title: Encapsulation (or Information Hiding)
pagenum: 217; title: Local Variables
pagenum: 217; title: Namespaces Associated with Function Calls
pagenum: 218; title: Namespaces and the Program Stack
pagenum: 219; label: 7.2
title: Global versus Local Namespaces
pagenum: 223; title: Global Variables
pagenum: 223; title: Variables with Local Scope
pagenum: 224; title: Variables with Global Scope
pagenum: 224; title: Changing Global Variables Inside a Function
pagenum: 226; label: 7.3
title: Exceptional Control Flow
pagenum: 227; title: Exceptions and Exceptional Control Flow
pagenum: 227; title: Catching and Handling Exceptions
pagenum: 228; title: The Default Exception Handler
pagenum: 230; title: Catching Exceptions of a Given Type
pagenum: 230; title: Multiple Exception Handlers
pagenum: 231; title: Controlling the Exceptional Control Flow
pagenum: 232; label: 7.4
title: Modules as Namespaces
pagenum: 235; title: Module Attributes
pagenum: 235; title: What Happens When Importing a Module
pagenum: 236; title: Module Search Path
pagenum: 236; title: Top-Level Module
pagenum: 238; title: Different Ways to Import Module Attributes
pagenum: 240; label: 7.5
title: Classes as Namespaces
pagenum: 242; title: A Class Is a Namespace
pagenum: 242; title: Class Methods Are Functions Defined in the Class Namespace
pagenum: 243; title: Chapter Summary
pagenum: 244; title: Solutions to Practice Problems
pagenum: 244; title: Exercises
pagenum: 245; title: Problems
pagenum: 248; label: 8
title: Object-Oriented Programming
pagenum: 251; label: 8.1
title: Defining a New Python Class
pagenum: 252; title: Methods of Class Point
pagenum: 252; title: A Class and Its Namespace
pagenum: 253; title: Every Object Has an Associated Namespace
pagenum: 254; title: Implementation of Class Point
pagenum: 254; title: Instance Variables
pagenum: 255; title: Instances Inherit Class Attributes
pagenum: 256; title: Class Definition, More Generally
pagenum: 257; title: Documenting a Class
pagenum: 258; title: Class Animal
pagenum: 259; label: 8.2
title: Examples of User-Defined Classes
pagenum: 260; title: Overloaded Constructor Operator
pagenum: 260; title: Default Constructor
pagenum: 261; title: Playing Card Class
pagenum: 262; label: 8.3
title: Designing New Container Classes
pagenum: 263; title: Designing a Class Representing a Deck of Playing Cards
pagenum: 263; title: Implementing the Deck (of Cards) Class
pagenum: 264; title: Container Class Queue
pagenum: 266; title: Implementing a Queue Class
pagenum: 267; label: 8.4
title: Overloaded Operators
pagenum: 268; title: Operators Are Class Methods
pagenum: 269; title: Making the Class Point User Friendly
pagenum: 270; title: Contract between the Constructor and the repr() Operator
pagenum: 272; title: Making the Queue Class User Friendly
pagenum: 274; label: 8.5
title: Inheritance
pagenum: 276; title: Inheriting Attributes of a Class
pagenum: 276; title: Class Definition, in General
pagenum: 279; title: Overriding Superclass Methods
pagenum: 279; title: Extending Superclass Methods
pagenum: 282; title: Implementing a Queue Class by Inheriting from list
pagenum: 283; label: 8.6
title: User-Defined Exceptions
pagenum: 284; title: Raising an Exception
pagenum: 285; title: User-Defined Exception Classes
pagenum: 286; title: Improving the Encapsulation of Class Queue
pagenum: 286; label: 8.7
title: Case Study: Indexing and Iterators
pagenum: 287; title: Overloading the Indexing Operators
pagenum: 287; title: Iterators and OOP Design Patterns
pagenum: 289; title: Chapter Summary
pagenum: 292; title: Solutions to Practice Problems
pagenum: 293; title: Exercises
pagenum: 296; title: Problems
pagenum: 299; label: 9
title: Graphical User Interfaces
pagenum: 309; label: 9.1
title: Basics of tkinter GUI Development
pagenum: 310; title: Widget Tk: The GUI Window
pagenum: 310; title: Widget Label for Displaying Text
pagenum: 310; title: Displaying Images
pagenum: 312; title: Packing Widgets
pagenum: 313; title: Arranging Widgets in a Grid
pagenum: 315; label: 9.2
title: Event-Based tkinter Widgets
pagenum: 317; title: Button Widget and Event Handlers
pagenum: 317; title: Events, Event Handlers, and mainloop()
pagenum: 319; title: The Entry Widget
pagenum: 320; title: Text Widget and Binding Events
pagenum: 323; title: Event Patterns and the tkinter Class Event
pagenum: 324; label: 9.3
title: Designing GUIs
pagenum: 326; title: Widget Canvas
pagenum: 326; title: Widget Frame as an Organizing Widget
pagenum: 329; label: 9.4
title: OOP for GUIs
pagenum: 331; title: GUI OOP Basics
pagenum: 331; title: Shared Widgets Are Assigned to Instance Variables
pagenum: 333; title: Shared Data Are Assigned to Instance Variables
pagenum: 335; label: 9.5
title: Case Study: Developing a Calculator
pagenum: 336; title: The Calculator Buttons and Passing Arguments to Handlers
pagenum: 337; title: Implementing the "Unofficial" Event Handler click()
pagenum: 338; title: Chapter Summary
pagenum: 341; title: Solutions to Practice Problems
pagenum: 341; title: Exercises
pagenum: 346; title: Problems
pagenum: 346; label: 10
title: Recursion
pagenum: 351; label: 10.1
title: Introduction to Recursion
pagenum: 352; title: Recursive Functions
pagenum: 352; title: Recursive Thinking
pagenum: 354; title: Recursive Function Calls and the Program Stack
pagenum: 356; label: 10.2
title: Examples of Recursion
pagenum: 358; title: Recursive Number Sequence Pattern
pagenum: 358; title: Fractals
pagenum: 360; title: Virus Scanner
pagenum: 364; label: 10.3
title: Run Time Analysis
pagenum: 367; title: The Exponent Function
pagenum: 367; title: Counting Operations
pagenum: 368; title: Fibonacci Sequence
pagenum: 369; title: Experimental Analysis of Run Time
pagenum: 370; label: 10.4
title: Searching
pagenum: 374; title: Linear Search
pagenum: 374; title: Binary Search
pagenum: 374; title: Other Search Problems
pagenum: 377; label: 10.5
title: Case Study: Tower of Hanoi
pagenum: 379; title: Classes Peg and Disk
pagenum: 383; title: Chapter Summary
pagenum: 385; title: Solutions to Practice Problems
pagenum: 385; title: Exercises
pagenum: 387; title: Problems
pagenum: 388; label: 11
title: The Web and Search
pagenum: 395; label: 11.1
title: The World Wide Web
pagenum: 396; title: Web Servers and Web Clients
pagenum: 396; title: "Plumbing" of the WWW
pagenum: 397; title: Naming Scheme: Uniform Resource Locator
pagenum: 397; title: Protocol: HyperText Transfer Protocol
pagenum: 398; title: Hyper Text Markup Language
pagenum: 399; title: HTML Elements
pagenum: 400; title: Tree Structure of an HTML Document
pagenum: 401; title: Anchor HTML Element and Absolute Links
pagenum: 401; title: Relative Links
pagenum: 402; label: 11.2
title: Python WWW API
pagenum: 403; title: Module urllib.request
pagenum: 403; title: Module html.parser
pagenum: 405; title: Overriding the HTMLParser Handlers
pagenum: 407; title: Module urllib.parse
pagenum: 408; title: Parser That Collects HTTP Hyperlinks
pagenum: 409; label: 11.3
title: String Pattern Matching
pagenum: 411; title: Regular Expressions
pagenum: 411; title: Python Standard Library Module re
pagenum: 414; label: 11.4
title: Case Study: Web Crawler
pagenum: 415; title: Recursive Crawler, Version 0.1
pagenum: 416; title: Recursive Crawler, Version 0.2
pagenum: 418; title: The Web Page Content Analysis
pagenum: 420; title: Chapter Summary
pagenum: 422; title: Solutions to Practice Problems
pagenum: 423; title: Exercises
pagenum: 425; title: Problems
pagenum: 426; label: 12
title: Databases and Data Processing
pagenum: 429; label: 12.1
title: Databases and SQL
pagenum: 430; title: Database Tables
pagenum: 430; title: Structured Query Language
pagenum: 432; title: Statement SELECT
pagenum: 432; title: Clause WHERE
pagenum: 434; title: Built-In SQL Functions
pagenum: 436; title: Clause GROUP BY
pagenum: 436; title: Making SQL Queries Involving Multiple Tables
pagenum: 437; title: Statement CREATE TABLE
pagenum: 439; title: Statements INSERT and UPDATE
pagenum: 439; label: 12.2
title: Database Programming in Python
pagenum: 440; title: Database Engines and SQLite
pagenum: 440; title: Creating a Database with sqlite3
pagenum: 441; title: Committing to Database Changes and Closing the Database
pagenum: 442; title: Querying a Database Using sqlite3
pagenum: 443; label: 12.3
title: Functional Language Approach
pagenum: 445; title: List Comprehension
pagenum: 445; title: MapReduce Problem Solving Framework
pagenum: 447; title: MapReduce, in the Abstract
pagenum: 450; title: Inverted Index
pagenum: 451; label: 12.4
title: Parallel Computing
pagenum: 453; title: Parallel Computing
pagenum: 453; title: Class Pool of Module multiprocessing
pagenum: 454; title: Parallel Speedup
pagenum: 457; title: MapReduce, in Parallel
pagenum: 458; title: Parallel versus Sequential MapReduce
pagenum: 459; title: Chapter Summary
pagenum: 461; title: Solutions to Practice Problems
pagenum: 462; title: Exercises
pagenum: 465; title: Problems
pagenum: 466; title: Index
pagenum: 471