Practice of Computing Using Python 2nd Edition Punch Solutions Manual

$26.99$50.00 (-46%)

In stock

Practice of Computing Using Python 2nd Edition Punch Solutions Manual.

Download sample

Practice of Computing Using Python 2nd Edition Punch Solutions Manual

Product details:

  • ISBN-10 ‏ : ‎ 0132830205
  • ISBN-13 ‏ : ‎ 978-0132830201
  • Author:

Now in its Third EditionPractice of Computing Using Pythoncontinues to effectively introduce readers to computational thinking using Python, with a strong emphasis on problem solving through computer science. The authors have chosen Python for its simplicity, powerful built-in data structures, advanced control constructs, and practicality. The text is built from the ground up for Python programming, rather than having been translated from Java or C++.

Focusing on data manipulation and analysis as a theme, the text allows readers to work on real problems using Internet-sourced or self-generated data sets that represent their own work and interests. The authors also emphasize program development and provide readers of all backgrounds with a practical foundation in programming that suit their needs. Among other changes, theThird Edition incorporates a switch to the Anaconda distribution, the SPYDER IDE, and a focus on debugging and GUIs.

Table contents:

  1. Part 1 Thinking About Computing
  2. Chapter 0 The Study of Computer Science
  3. 0.1 Why Computer Science?
  4. 0.1.1 Importance of Computer Science
  5. 0.1.2 Computer Science Around You
  6. 0.1.3 Computer “Science”
  7. Theory of Computation
  8. Computational Efficiency
  9. Algorithms and Data Structures
  10. Parallel Processing
  11. Software Engineering
  12. Many Others
  13. 0.1.4 Computer Science Through Computer Programming
  14. 0.2 The Difficulty and Promise of Programming
  15. 0.2.1 Difficulty 1: Two Things at Once
  16. Poetry to Programming?
  17. 0.2.2 Difficulty 2: What Is a Good Program?
  18. It’s All About Problem Solving
  19. A Program as an Essay
  20. 0.2.3 The Promise of a Computer Program
  21. 0.3 Choosing a Computer Language
  22. 0.3.1 Different Computer Languages
  23. 0.3.2 Why Python?
  24. Python Philosophy
  25. A “Best Practices” Language
  26. Python Is Open Source
  27. A rising tide lifts all boats
  28. 0.3.3 Is Python the Best Language?
  29. 0.4 What Is Computation?
  30. 0.5 What Is a Computer?
  31. 0.5.1 Computation in Nature
  32. The Human Brain
  33. Evolutionary Computation
  34. 0.5.2 The Human Computer
  35. 0.6 The Modern, Electronic Computer
  36. 0.6.1 It’s the Switch!
  37. 0.6.2 The Transistor
  38. Smaller Size
  39. Quantity and Function
  40. Faster
  41. 0.7 A High-Level Look at a Modern Computer
  42. 0.8 Representing Data
  43. 0.8.1 Binary Data
  44. 0.8.2 Working with Binary
  45. 0.8.3 Limits
  46. Bits, Bytes, and Words
  47. 0.8.4 Representing Letters
  48. 0.8.5 Representing Other Data
  49. Images
  50. Music
  51. 0.8.6 What Does a Number Represent?
  52. 0.8.7 How to Talk About Quantities of Data
  53. 0.8.8 How Much Data Is That?
  54. 0.9 Overview of Coming Chapters
  55. Summary
  56. Part 2 Starting to Program
  57. Chapter 1 Beginnings
  58. 1.1 Practice, Practice, Practice
  59. 1.2 Quickstart, the Circumference Program
  60. 1.2.1 Examining the Code
  61. 1.3 An Interactive Session
  62. 1.4 Parts of a Program
  63. 1.4.1 Modules
  64. 1.4.2 Statements and Expressions
  65. 1.4.3 Whitespace
  66. Indentation
  67. Continuation
  68. 1.4.4 Comments
  69. 1.4.5 Special Python Elements: Tokens
  70. Keywords
  71. Operators
  72. Punctuators and Delimiters
  73. Literals
  74. 1.4.6 Naming Objects
  75. 1.4.7 Recommendations on Naming
  76. 1.5 Variables
  77. 1.5.1 Variable Creation and Assignment
  78. Check Yourself: Variables and Assignment
  79. 1.6 Objects and Types
  80. 1.6.1 Numbers
  81. Integers
  82. Floating-Point Numbers
  83. Fractions
  84. 1.6.2 Other Built-In Types
  85. Boolean
  86. String
  87. List
  88. Dictionary
  89. Set
  90. 1.6.3 Object Types: Not Variable Types
  91. 1.6.4 Constructing New Values
  92. 1.7 Operators
  93. 1.7.1 Integer Operators
  94. 1.7.2 Floating-Point Operators
  95. 1.7.3 Mixed Operations
  96. 1.7.4 Order of Operations and Parentheses
  97. 1.7.5 Augmented Assignment Operators: A Shortcut!
  98. Check Yourself: Types and Operators
  99. 1.8 Your First Module, Math
  100. 1.9 Developing an Algorithm
  101. 1.9.1 New Rule—Testing
  102. 1.10 Turtle Graphics
  103. 1.11 What’s Wrong with My Code?
  104. Summary
  105. Elements
  106. Built-in Types
  107. Rules
  108. Exercises
  109. Programming Projects
  110. Chapter 2 Control
  111. 2.1 QuickStart Control
  112. 2.1.1 Selection
  113. 2.1.2 Booleans for Decisions
  114. 2.1.3 The if Statement
  115. The Basic if Statement
  116. Indentation and a Suite of Python Code
  117. The if-else Statement
  118. 2.1.4 Example: What Lead Is Safe in Basketball?
  119. 2.1.5 Repetition
  120. Basic While
  121. Iteration: The Basic for Statement
  122. 2.1.6 Example: Finding Perfect Numbers
  123. Program to Evaluate Whether a Number Is Perfect
  124. A Note on Naming
  125. Putting It All Together
  126. 2.1.7 Example: Classifying Numbers
  127. The Process of Changing a Program
  128. Looking at a Range of Numbers
  129. Summing Divisors
  130. Classify the Numbers
  131. Check Yourself: Basic Control Check
  132. 2.2 In-Depth Control
  133. 2.2.1 True and False: Booleans
  134. 2.2.2 Boolean Variables
  135. 2.2.3 Relational Operators
  136. What Does It Mean to be Equal?
  137. Chained Relational Operators
  138. 2.2.4 Boolean Operators
  139. 2.2.5 Precedence
  140. 2.2.6 Boolean Operators Example
  141. Check Yourself: Loop Control Check
  142. 2.2.7 Another Word on Assignments
  143. Multiple Assignment
  144. Swap
  145. 2.2.8 The Selection Statement for Decisions
  146. 2.2.9 More on Python Decision Statements
  147. The if-elif-else Statement
  148. Mixing and Matching elif and else
  149. Updating Our Perfect Number Example
  150. 2.2.10 Repetition: the while Statement
  151. Basic Repetition and the while Loop
  152. Loop Control and Initialization
  153. Check Yourself: More Control Check
  154. else and break
  155. Break Statement and Non-Normal Exit
  156. More Control Inside of a while Loop
  157. Continue
  158. Checking User Input for Errors
  159. The pass Statement
  160. 2.2.11 Sentinel Loop
  161. 2.2.12 Summary of Repetition
  162. 2.2.13 More on the for Statement
  163. Using range to Generate a Number Sequence
  164. The range Function and Iterables
  165. Equivalence of while and for
  166. Refactor Perfect Numbers Using for
  167. 2.2.14 Nesting
  168. Check Yourself: for and range Check
  169. 2.2.15 Hailstone Sequence Example
  170. 2.3 Plotting Data with pylab
  171. 2.3.1 First Plot and Using a List
  172. 2.3.2 More Interesting Plot: A Sine Wave
  173. Plotting Elements and Their Colors
  174. More Detailed Call of Plot
  175. 2.4 Computer Science Perspectives: Minimal Universal Computing
  176. 2.4.1 Minimal Universal Computing
  177. 2.5 What’s Wrong with My Code?
  178. Summary
  179. Selection: if-elif-else
  180. Repetition: while
  181. Iteration: for
  182. Rules
  183. Exercises
  184. Programming Projects
  185. Chapter 3 Algorithms and Program Development
  186. 3.1 What Is an Algorithm?
  187. 3.1.1 Example Algorithms
  188. 3.2 Algorithm Features
  189. 3.2.1 Algorithm versus Program
  190. 3.2.2 Qualities of an Algorithm
  191. Detailed
  192. Effective
  193. Specify Behavior
  194. General Purpose Algorithms
  195. 3.2.3 Can We Really Do All That?
  196. 3.3 What Is a Program?
  197. 3.3.1 Readability
  198. The Simplest Thing: Good Names
  199. Comments
  200. Indenting Code
  201. 3.3.2 Robust
  202. 3.3.3 Correctness
  203. 3.4 Strategies for Program Design
  204. 3.4.1 Engage and Commit
  205. 3.4.2 Understand, Then Visualize
  206. What Is the Actual Problem?
  207. Making the Problem Real
  208. 3.4.3 Think Before You Program
  209. 3.4.4 Experiment
  210. 3.4.5 Simplify
  211. The “Onion” Approach
  212. 3.4.6 Stop and Think
  213. 3.4.7 Relax: Give Yourself a Break
  214. 3.5 A Simple Example
  215. 3.5.1 Build the Skeleton
  216. 3.5.2 Output
  217. 3.5.3 Input
  218. Testing the Input Routine
  219. 3.5.4 Doing the Calculation
  220. Summary
  221. Algorithms
  222. Rules
  223. Exercises
  224. Part 3 Data Structures and Functions
  225. Chapter 4 Working with Strings
  226. 4.1 The String Type
  227. 4.1.1 The Triple-Quote String
  228. 4.1.2 Nonprinting Characters
  229. 4.1.3 aString Representation
  230. 4.1.4 Strings as a Sequence
  231. 4.1.5 More Indexing and Slicing
  232. Extended Slicing
  233. Copy Slice
  234. 4.1.6 Strings Are Iterable
  235. Check Yourself: Slicing Check
  236. 4.2 String Operations
  237. 4.2.1 Concatenation (+) and Repetition (*)
  238. 4.2.2 Determining When + Indicates Addition or Concatenation?
  239. The type Function
  240. 4.2.3 Comparison Operators
  241. Single-Character String Compares
  242. Comparing Strings with More Than One Character
  243. 4.2.4 The in Operator
  244. 4.2.5 String Collections Are Immutable
  245. Check Yourself: String Comparison Check
  246. 4.3 A Preview of Functions and Methods
  247. 4.3.1 A String Method
  248. Chaining of Methods
  249. Optional Arguments
  250. Nesting of Methods
  251. 4.3.2 Determining Method Names and Method Arguments
  252. 4.3.3 String Methods
  253. 4.3.4 String Functions
  254. 4.4 Formatted Output for Strings
  255. 4.4.1 Descriptor Codes
  256. 4.4.2 Width and Alignment Descriptors
  257. 4.4.3 Floating-Point Precision Descriptor
  258. Check Yourself: More String Manipulation Check
  259. 4.5 Control and Strings
  260. 4.6 Working with Strings
  261. 4.6.1 Example: Reordering a Person’s Name
  262. 4.6.2 Palindromes
  263. Changing Case
  264. Only Letters and Digits
  265. Putting It All Together
  266. 4.7 More String Formatting
  267. 4.8 Unicode
  268. 4.9 A GUI to Check a Palindrome
  269. 4.10 What’s Wrong with My Code?
  270. Summary
  271. Strings
  272. Indexing and Slicing
  273. Formatting
  274. Iteration: for, enumerate
  275. Rules
  276. Exercises
  277. Programming Projects
  278. Chapter 5 Functions—QuickStart
  279. 5.1 What Is a Function?
  280. 5.1.1 Why Have Functions?
  281. 5.2 Python Functions
  282. 5.3 Flow of Control with Functions
  283. 5.3.1 Function Flow in Detail
  284. 5.3.2 Parameter Passing
  285. Check Yourself: Simple Functions Check
  286. 5.3.3 Another Function Example
  287. 5.3.4 Function Example: Area of a Triangle
  288. Input
  289. Find Side Length
  290. Calculate Area
  291. Whole Program
  292. 5.3.5 Functions Calling Functions
  293. 5.3.6 When to Use a Function
  294. 5.3.7 What If There Is No Return Statement?
  295. 5.3.8 What If There Are Multiple Return Statements?
  296. 5.4 : Turtle Flag
  297. 5.5 What’s Wrong with My Code?
  298. Summary
  299. Functions
  300. Rules
  301. Exercises
  302. Programming Projects
  303. Chapter 6 Files and Exceptions I
  304. 6.1 What Is a File?
  305. 6.2 Accessing Files: Reading Text Files
  306. 6.2.1 What’s Really Happening?
  307. 6.3 Accessing Files: Writing Text Files
  308. 6.4 Reading and Writing Text Files in a Program
  309. 6.5 File Creation and Overwriting
  310. Check Yourself: File Check
  311. 6.5.1 Files and Functions Example: Word Puzzle
  312. Reading a File of Words
  313. Searching a File of Words
  314. Solving the Puzzle
  315. Check Yourself: Function Practice with Strings
  316. 6.6 First Cut, Handling Errors
  317. 6.6.1 Error Names
  318. 6.6.2 The try-except Construct
  319. 6.6.3 try-except Flow of Control
  320. 6.6.4 Exception Example
  321. Check Yourself: Exception Check
  322. 6.7 Example: Counting Poker Hands
  323. 6.7.1 Program to Count Poker Hands
  324. Program to Count the Total Hands in the File
  325. Program to Count the Hands with One Pair
  326. Program to Calculate the Probability of One Pair
  327. Error Checking
  328. The Rest of the Program
  329. Observations on the Output
  330. 6.8 GUI to Count Poker Hands
  331. 6.8.1 Count Hands Function
  332. 6.8.2 The Rest of the GUI Code
  333. 6.9 Error Check Float Input
  334. 6.10 What’s Wrong with My Code?
  335. Summary
  336. Files
  337. Exceptions
  338. Rules
  339. Exercises
  340. Programming Projects
  341. Chapter 7 Lists and Tuples
  342. 7.1 What is a List?
  343. 7.2 What You Already Know How To Do With Lists
  344. 7.2.1 Indexing and Slicing
  345. 7.2.2 Operators
  346. 7.2.3 Functions
  347. 7.2.4 List Iteration
  348. 7.3 Lists Are Different than Strings
  349. 7.3.1 Lists Are Mutable
  350. 7.3.2 List Methods
  351. Nonmodifying Methods
  352. Methods That Modify the List
  353. More on Sorting
  354. Check Yourself: Basic Lists Check
  355. 7.4 Old and New Friends: Split and Other Functions and Methods
  356. 7.4.1 Split and Multiple Assignment
  357. 7.4.2 List to String and Back Again, Using join
  358. 7.4.3 The Sorted Function
  359. Check Yourself: Lists and Strings Check
  360. 7.5 Working with Some Examples
  361. 7.5.1 Anagrams
  362. Refactoring
  363. 7.5.2 Example: File Analysis
  364. Length of Gettysburg Address
  365. Unique Words in Gettysburg Address
  366. Better Idea of Unique
  367. 7.6 Mutable Objects and References
  368. 7.6.1 Shallow versus Deep Copy
  369. 7.6.2 Mutable versus Immutable
  370. Check Yourself: Mutable List Check
  371. 7.7 Tuples
  372. 7.7.1 Tuples from Lists
  373. 7.7.2 Why Tuples?
  374. 7.8 Lists: The Data Structure
  375. 7.8.1 Example Data Structure
  376. 7.8.2 Other Example Data Structures
  377. 7.9 Algorithm Example: U.S. EPA Automobile Mileage Data
  378. 7.9.1 csv Module
  379. 7.10 Plotting EPA Data
  380. 7.11 List Comprehension
  381. 7.11.1 Comprehensions, Expressions, and the Ternary Operator
  382. 7.12 More Plotting
  383. 7.12.1 Pylab Arrays
  384. Arrays and range
  385. Broadcasting
  386. 7.12.2 Plotting Trigonometric Functions
  387. 7.13 GUI to Find Anagrams
  388. 7.13.1 Function Model
  389. 7.13.2 Controller
  390. 7.14 What’s Wrong with My Code?
  391. Summary
  392. Lists and Tuples
  393. Indexing and Slicing
  394. List Methods (Partial List)
  395. Methods Shared by Lists and Tuples (Partial List)
  396. Iteration: for, Enumerate
  397. Rules
  398. Exercises
  399. Programming Projects
  400. Chapter 8 More on Functions
  401. 8.1 Scope
  402. 8.1.1 Arguments, Parameters, and Namespaces
  403. 8.1.2 Passing Mutable Objects
  404. 8.1.3 Returning a Complex Object
  405. Check Yourself: Passing Mutables Check
  406. 8.1.4 Refactoring evens
  407. 8.2 Default Values and Parameters as Keywords
  408. 8.2.1 Example: Default Values and Parameter Keywords
  409. Issues with Default Values
  410. Check Yourself: More on Functions Check
  411. 8.3 Functions as Objects
  412. 8.3.1 Function Annotations
  413. 8.3.2 Docstrings
  414. 8.4 Example: Determining a Final Grade
  415. 8.4.1 The Data
  416. 8.4.2 The Design
  417. 8.4.3 Function: weighted_grade
  418. 8.4.4 Function: parse_line
  419. 8.4.5 Function: main
  420. 8.4.6 Example Use
  421. 8.5 Pass ”’By Value” or ”By Reference”
  422. 8.6 What’s Wrong with My Code?
  423. Summary
  424. Functions
  425. Rules
  426. Exercises
  427. Programming Projects
  428. Chapter 9 Dictionaries and Sets
  429. 9.1 Dictionaries
  430. 9.1.1 Dictionary Example
  431. 9.1.2 Python Dictionaries
  432. 9.1.3 Dictionary Indexing and Assignment
  433. Dictionaries Are Mutable
  434. Dictionaries with Different Key Types
  435. 9.1.4 Operators
  436. Familiar Collection Operations
  437. Some Dictionary Methods
  438. Check Yourself: Dictionary Check
  439. 9.1.5 Ordered Dictionaries
  440. 9.2 Word Count Example
  441. 9.2.1 Count Words in a String
  442. 9.2.2 Word Frequency for Gettysburg Address
  443. add_word
  444. process_line
  445. pretty_print
  446. main
  447. 9.2.3 Output and Comments
  448. 9.3 Periodic Table Example
  449. 9.3.1 Working with CSV Files
  450. 9.3.2 Algorithm Overview
  451. 9.3.3 Functions for Divide and Conquer
  452. read_table
  453. parse_element(element_str)
  454. 9.4 Sets
  455. 9.4.1 History
  456. 9.4.2 What’s in a Set?
  457. 9.4.3 Python Sets
  458. Python Sets are Mutable
  459. 9.4.4 Methods, Operators, and Functions for Python Sets
  460. Typical Operations
  461. 9.4.5 Set Methods
  462. Intersection
  463. Union
  464. Difference
  465. Symmetric Difference
  466. Subset and Superset
  467. Check Yourself: Set Check
  468. Other Set methods
  469. 9.5 Set Applications
  470. 9.5.1 Relationship between Words of Different Documents
  471. add_word
  472. process_line
  473. main
  474. pretty_print
  475. 9.5.2 Output and Comments
  476. 9.6 Scope: The Full Story
  477. 9.6.1 Namespaces and Scope
  478. 9.6.2 Search Rule for Scope
  479. 9.6.3 Local
  480. 9.6.4 Global
  481. The Local Assignment Rule
  482. The global Statement
  483. 9.6.5 Built-Ins
  484. 9.6.6 Enclosed
  485. 9.7 Using zip to Create Dictionaries
  486. 9.8 Dictionary and Set Comprehensions
  487. 9.9 Bar Graph of Word Frequency
  488. 9.9.1 Getting the Data Right
  489. 9.9.2 Labels and the xticks Command
  490. 9.9.3 Plotting
  491. 9.10 GUI to Compare Files
  492. 9.10.1 Controller and View
  493. 9.10.2 Function Model
  494. 9.11 What’s Wrong with My Code?
  495. Summary
  496. Dictionaries
  497. Sets
  498. Scope
  499. Rules
  500. Exercises
  501. Programming Projects
  502. Chapter 10 More Program Development
  503. 10.1 Introduction
  504. 10.2 Divide and Conquer
  505. 10.2.1 Top-Down Refinement
  506. 10.3 The Breast Cancer Classifier
  507. 10.3.1 The Problem
  508. 10.3.2 The Approach: Classification
  509. 10.3.4 Training and Testing the Classifier
  510. 10.3.4 Building the Classifier
  511. 10.4 Designing the Classifier Algorithm
  512. 10.4.1 Divided, now Conquer
  513. 10.4.2 Data Structures
  514. 10.4.3 File Format
  515. 10.4.4 The make_training_set Function
  516. 10.4.5 The make_test_set Function
  517. 10.4.6 The train_classifier Function
  518. Some Utility Functions for Manipulating Lists
  519. The sum_lists Function
  520. The make_averages Function
  521. 10.4.7 train_classifier, Round 2
  522. A Little Testing
  523. 10.4.8 Testing the Classifier on New Data
  524. Testing the classify_test_set Function
  525. 10.4.9 The report_results Function
  526. 10.5 Running the Classifier on Full Data
  527. 10.5.1 Training versus Testing
  528. 10.6 Other Interesting Problems
  529. 10.6.1 Tag Clouds
  530. 10.6.2 S&P 500 Predictions
  531. 10.6.3 Predicting Religion with Flags
  532. 10.7 GUI to Plot the Stock Market
  533. 10.7.1 Function Model
  534. 10.7.2 Controller and View
  535. Summary
  536. Rules
  537. Exercises
  538. Programming Projects
  539. Part 4 Classes, Making Your Own Data Structures and Algorithms
  540. Chapter 11 Introduction to Classes
  541. 11.1 Quickstart: Simple Student Class
  542. 11.2 Object-Oriented Programming
  543. 11.2.1 Python Is Object-Oriented!
  544. 11.2.2 Characteristics of OOP
  545. 11.3 Working with OOP
  546. 11.3.1 Class and Instance
  547. 11.4 Working with Classes and Instances
  548. 11.4.1 Built-In Class and Instance
  549. 11.4.2 Our First Class
  550. A Simple Instance
  551. 11.4.3 Changing Attributes
  552. 11.4.4 The Special Relationship Between an Instance and Class: instance-of
  553. Part of the Python Scope Rules for Objects: Instance, then Class
  554. 11.5 Object Methods
  555. 11.5.1 Using Object Methods
  556. 11.5.2 Writing Methods
  557. 11.5.3 The Special Argument self
  558. Check Yourself: Basic Classes Check
  559. 11.5.4 Methods Are the Interface to a Class Instance
  560. 11.6 Fitting into the Python Class Model
  561. 11.6.1 Making Programmer-Defined Classes
  562. 11.6.2 A Student Class
  563. 11.6.3 Python Standard Methods
  564. Initializing the Instance
  565. Printing the Instance
  566. Changing an Instance
  567. Check Yourself: Defining Special Methods
  568. 11.6.4 Now There Are Three: Class Designer, Programmer, and User
  569. 11.7 Example: Point Class
  570. 11.7.1 Construction
  571. 11.7.2 Distance
  572. 11.7.3 Summing Two Points
  573. 11.7.4 Improving the Point Class
  574. Default Initialization
  575. “Do the Right Thing”: Printing the Values
  576. Updated Point Class
  577. 11.8 Python and OOP
  578. 11.8.1 Encapsulation
  579. 11.8.2 Inheritance
  580. 11.8.3 Polymorphism
  581. 11.9 Python and Other OOP languages
  582. 11.9.1 Public versus Private
  583. 11.9.2 Indicating Privacy Using Double Underscores (__)
  584. 11.9.3 Python’s Philosophy
  585. 11.9.4 Modifying an Instance
  586. 11.10 What’s Wrong with My Code?
  587. Summary
  588. Classes
  589. Rules
  590. Exercises
  591. Programming Projects
  592. Chapter 12 More on Classes
  593. 12.1 More About Class Properties
  594. 12.1.1 Rational Number (Fraction) Class Example
  595. Variation on Import, from
  596. 12.2 How Does Python Know?
  597. 12.2.1 Classes, Types, and Introspection
  598. 12.2.2 Remember Operator Overloading
  599. 12.3 Creating Your Own Operator Overloading
  600. 12.3.1 Mapping Operators to Special Methods
  601. 12.4 Building the Rational Number Class
  602. 12.4.1 Making the Class
  603. 12.4.2 Review Fraction Addition
  604. Euclid and the GCD
  605. 12.4.3 Back to Adding Fractions
  606. Assignment
  607. Check Yourself: Check Defining Your Own Operators
  608. 12.4.4 Equality and Reducing Rationals
  609. 12.4.5 Divide and Conquer at Work
  610. 12.5 What Doesn’t Work (Yet)
  611. 12.5.1 Introspection
  612. 12.5.2 Repairing int + Rational Errors
  613. Mixed-Type Comparisons
  614. Collection Operators and Iteration
  615. 12.6 Inheritance
  616. 12.6.1 The “Find the Attribute” Game
  617. Class “is-a” Relationship and the Class Hierarchy
  618. Back to the Game
  619. 12.6.2 Using Inheritance
  620. Group Development and OOP
  621. 12.6.3 Example: The Standard Model
  622. Using Parent Class Methods
  623. Changing Code Using Class Inheritance
  624. 12.7 What’s Wrong with My Code?
  625. Summary
  626. Classes
  627. Rules
  628. Exercises
  629. Chapter 13 Program Development with Classes
  630. 13.1 Predator-Prey Problem
  631. 13.1.1 The Rules
  632. 13.1.2 Simulation Using Object-Oriented Programming
  633. 13.2 Classes
  634. 13.2.1 Island Class
  635. 13.2.2 Predator and Prey, Kinds of Animals
  636. Animal Object
  637. 13.2.3 Predator and Prey Classes
  638. 13.2.4 Object Diagram
  639. 13.2.5 Filling the Island
  640. Querying a Grid Location
  641. Repeat Until Full
  642. 13.3 Adding Behavior
  643. 13.3.1 Refinement: Add Movement
  644. Falling off the Island?
  645. 13.3.2 Refinement: Time Simulation Loop
  646. 13.4 Refinement: Eating, Breeding, and Keeping Time
  647. 13.4.1 Improved Time Loop
  648. Remembering the Breed and Starve Time Spans
  649. Updating the __init__ Methods
  650. 13.4.2 Breeding
  651. The “Neighbor” Method and Updating Move
  652. Back to Breeding
  653. 13.4.3 Eating
  654. 13.4.4 The Tick of the Clock
  655. 13.5 Refinement: How Many Times to Move?
  656. 13.6 Graphing Population Size
  657. Summary
  658. Exercises
  659. Part 5 Being a Better Programmer
  660. Chapter 14 Files and Exceptions II
  661. 14.1 More Details on Files
  662. 14.1.1 Other File Access Methods, Reading
  663. 14.1.2 Other File Access Methods, Writing
  664. 14.1.3 Universal New Line Format
  665. 14.1.4 Moving Around in a File
  666. 14.1.5 Closing a File
  667. 14.1.6 The with Statement
  668. 14.1.7 Text File Encodings; Unicode
  669. Check Yourself: Basic File Operations
  670. 14.2 CSV Files
  671. 14.2.1 CSV Module
  672. 14.2.2 CSV Reader
  673. 14.2.3 CSV Writer
  674. 14.2.4 Example: Update Some Grades
  675. 14.3 Module: os
  676. 14.3.1 Directory (Folder) Structure
  677. 14.3.2 os Module Functions
  678. 14.3.3 os Module Example
  679. 14.4 More on Exceptions
  680. 14.4.1 Basic Exception Handling
  681. 14.4.2 A Simple Example
  682. Multiple Exceptions in One except
  683. No Exception except
  684. 14.4.3 Events
  685. 14.4.4 A Philosophy Concerning Exceptions
  686. 14.5 Exception: else and finally
  687. 14.5.1 finally and with
  688. 14.5.2 Example: Refactoring the Reprompting of a File Name
  689. 14.6 More on Exceptions
  690. 14.6.1 Raise
  691. Check Yourself: Basic Exception Control
  692. 14.6.2 Create Your Own
  693. 14.7 Example: Password Manager
  694. Summary
  695. Files
  696. Exceptions
  697. Exercises
  698. Programming Projects
  699. Chapter 15 Recursion: Another Control Mechanism
  700. 15.1 What Is Recursion?
  701. 15.2 Mathematics and Rabbits
  702. 15.3 Let’s Write Our Own: Reversing a String
  703. 15.4 How Does Recursion Actually Work?
  704. 15.4.1 Stack Data Structure
  705. 15.4.2 Stacks and Function Calls
  706. 15.4.3 A Better Fibonacci
  707. 15.5 Recursion in Figures
  708. 15.5.1 Recursive Tree
  709. 15.5.2 Sierpinski Triangles
  710. 15.6 Recursion to Non-recursion
  711. 15.7 GUI for Turtle Drawing
  712. 15.7.1 Using Turtle Graphics to Draw
  713. 15.7.2 Function Model
  714. 15.7.3 Controller and View
  715. Summary
  716. Exercises
  717. Chapter 16 Other Fun Stuff with Python
  718. 16.1 Numbers
  719. 16.1.1 Fractions
  720. Fraction Construction
  721. Fraction Operations
  722. 16.1.2 Decimal
  723. Decimal Construction
  724. Decimal Operations
  725. Other Decimal Properties
  726. 16.1.3 Complex Numbers
  727. Python Complex Numbers
  728. Complex Numbers and cmath
  729. 16.1.4 Statistics Module
  730. Averages and Central Location
  731. Measures of Spread
  732. 16.1.5 Random Numbers
  733. 16.2 Even More on Functions
  734. 16.2.1 Having a Varying Number of Parameters
  735. Multiple Positional Arguments
  736. Multiple Keyword Arguments
  737. 16.2.2 Iterators and Generators
  738. Iterator Objects
  739. Collections and Iterator Objects
  740. How for Works
  741. Generators
  742. Why Generators?
  743. 16.2.3 Other Functional Programming Ideas
  744. Anonymous Functions, Lambda
  745. 16.2.4 Some Functional Programming Tools
  746. 16.2.5 Decorators: Functions Calling Functions
  747. Passing a Function Object as a Parameter
  748. Decorators
  749. Why Is This a “Good Thing”
  750. 16.3 Classes
  751. 16.3.1 Properties
  752. 16.3.2 Serializing an Instance: pickle
  753. Restrictions
  754. 16.4 Other Things in Python
  755. 16.4.1 Data Types
  756. 16.4.2 Built-in Modules
  757. 16.4.3 Modules on the Internet
  758. Chapter 17 The End, or Perhaps the Beginning
  759. Appendices
  760. Appendix A Getting and Using Python
  761. A.1 About Python
  762. A.1.1 History
  763. A.1.2 Python 3
  764. A.1.3 Python Is Free and Portable
  765. What You Get
  766. A.1.4 Installing Anaconda
  767. A.1.5 Starting Our Python IDE: Spyder
  768. A.1.6 Working with Python
  769. A.1.7 Making a Program
  770. A Couple of Early Tips
  771. Exploring Spyder
  772. A.2 The iPython Console
  773. A.2.1 Anatomy of an iPython Session
  774. A.2.2 Your Top Three iPython Tips
  775. The Arrow Keys and Your History
  776. A.2.3 Completion and the Tab Key
  777. A.2.4 The ? Character
  778. A.2.5 More iPython Tips
  779. A.3 Some Conventions for This Book
  780. A.3.1 Interactive Code
  781. A.3.2 Program: Written Code
  782. A.3.3 Combined Program and Output
  783. A.4 Summary
  784. Appendix B Simple Drawing with Turtle Graphics
  785. B.1 Tidbits
  786. B.1.1 Reset/Close the Turtle Window
  787. Appendix C What’s Wrong with My Code?
  788. C.1 It’s Your Fault!
  789. C.1.1 Kinds of Errors
  790. Testing for Runtime and Semantic Errors
  791. C.1.2 “Bugs” and Debugging
  792. C.2 Debugging
  793. C.2.1 Testing for Correctness
  794. C.2.2 Probes
  795. C.2.3 Debugging with Spyder Example 1
  796. C.2.4 Debugging Example 1 Using print()
  797. C.2.5 Debugging with Spyder Example 2
  798. C.2.6 More Debugging Tips
  799. C.3 More about Testing
  800. C.3.1 Testing Is Hard!
  801. Correctness
  802. C.3.2 Importance of Testing
  803. C.3.3 Other Kinds of Testing
  804. C.4 What’s Wrong with My Code?
  805. C.4.1 Chapter 1: Beginnings
  806. C.4.2 Chapter 2: Control
  807. C.4.3 Chapter 4: Strings
  808. C.4.4 Chapter 5: Functions
  809. C.4.5 Chapter 6: Files and Exceptions
  810. C.4.6 Chapter 7: Lists and Tuples
  811. C.4.7 Chapter 8: More Functions
  812. C.4.8 Chapter 9: Dictionaries
  813. C.4.9 Chapter 11: Classes I
  814. C.4.10 Chapter 12: Classes II
  815. Summary
  816. Appendix D Pylab: A Plotting and Numeric Tool
  817. D.1 Plotting
  818. D.2 Working with pylab
  819. D.2.1 Plot Command
  820. D.2.2 Colors, Marks, and Lines
  821. D.2.3 Generating X-Values
  822. D.2.4 Plot Properties
  823. D.2.5 Tick Labels
  824. D.2.6 Legend
  825. D.2.7 Bar Graphs
  826. D.2.8 Histograms
  827. D.2.9 Pie Charts
  828. D.2.10 How Powerful Is pylab?
  829. Appendix E Quick Introduction to Web-based User Interfaces
  830. E.1 Flask
  831. E.2 QuickStart Flask, Hello World
  832. E.2.1 What Just Happened?
  833. E.2.2 Multiple Routes
  834. E.2.3 Stacked Routes, Passing Address Arguments
  835. E.3 Serving Up Real HTML Pages
  836. E.3.1 A Little Bit of HTML
  837. E.3.2 HTML Tags
  838. List of HTML Tags
  839. E.3.3 Flask Returning Web Pages
  840. E.3.4 Getting Arguments into Our Web Pages
  841. E.4 Active Web Pages
  842. E.4.1 Forms in wtforms
  843. E.4.2 A Good Example Goes a Long Way
  844. More About the Controller
  845. More About the View
  846. More About the Model
  847. E.4.3 Many Fields Example
  848. The Model
  849. The View
  850. The Controller
  851. Imports
  852. InputForm
  853. Route Function
  854. E.5 Displaying and Updating Images
  855. E.6 Odds and Ends
  856. Appendix F Table of UTF-8 One Byte Encodings
  857. Appendix G Precedence
  858. Appendix H Naming Conventions
  859. H.1 Python Style Elements
  860. H.2 Naming Conventions
  861. H.2.1 Our Added Naming Conventions
  862. H.3 Other Python Conventions
  863. Appendix I Check Yourself Solutions
  864. I.1 Chapter 1
  865. Variables and Assignment
  866. Types and Operators
  867. I.2 Chapter 2
  868. Basic Control Check
  869. Loop Control Check
  870. More Control Check
  871. for and range Check
  872. I.3 Chapter 4
  873. Slicing Check
  874. String Comparison Check
  875. I.4 Chapter 5
  876. Simple Functions Check
  877. I.5 Chapter 6
  878. Exception Check
  879. Function Practice with Strings
  880. I.6 Chapter 7
  881. Basic Lists Check
  882. Lists and Strings Check
  883. Mutable List Check
  884. I.7 Chapter 8
  885. Passing Mutables Check
  886. More on Functions Check
  887. I.8 Chapter 9
  888. Dictionary Check
  889. Set Check
  890. I.9 Chapter 11
  891. Basic Classes Check
  892. Defining Special Methods
  893. I.10 Chapter 12
  894. Check Defining Your Own Operators
  895. I.11 Chapter 14
  896. Basic File Operations
  897. Basic Exception Control
  898. Index

People also search:

practice of computing using python

the practice of computing using python

practice of computing using python 2nd

practice of computing using python 2nd pdf free

practice of computing using python 2nd download scribd

Instant download after Payment is complete

Main Menu