You are previewing Python Programming in Context, 2nd Edition.
O'Reilly logo
Python Programming in Context, 2nd Edition

Book Description

The user-friendly, object-oriented programming language Python is quickly becoming the most popular introductory programming language for both students and instructors. This updated Second Edition of Python Programming in Context provides a comprehensive, accessible introduction to Python fundamentals. An ideal first language for learners entering the rapidly expanding field of computer science, Python gives students a solid platform of key problem-solving skills that translate easily across programming languages. Building on essential concepts of computer science, and offering a plenitude of real-world examples, Python Programming in Context, Second Edition offers a thorough overview of multiple applied areas, including image processing, cryptography, astronomy, the Internet, and bioinformatics. The text’s emphasis on problem-solving, extrapolation, and development of independent exploration and solution-building provides students with a unique and innovative approach to learning programming. Python Programming in Context, Second Edition is the ideal introductory text for those delving into computer programming. Key Features - Utilizes Python 3 - Provides a clear, accessible, and skill-focused approach to programming with Python - Contains problem sets based on real-world examples and problem-solving rather than language features - Offers a variety of exercises that develop independent skill-building and exploration - Every new copy of the text is packaged with full student access to Turing's Craft Custom CodeLab. Customized to match the organization of the text, CodeLab offers students hands-on Python programming experience with immediate feedback. - Accompanied by a full suite of instructor support material, including solutions to the exercises in the text, downloadable source code, PowerPoint Lecture Outlines, and a complete Test Bank.

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Dedication
  4. Preface
  5. Turing’s Craft CodeLab Student Registration Instructions
  6. Contents
  7. Chapter 1: Introduction
    1. 1.1 Objectives
    2. 1.2 What Is Computer Science?
    3. 1.3 Why Study Computer Science?
    4. 1.4 Problem-Solving Strategies
    5. 1.5 Python Overview
    6. 1.6 Summary
  8. Chapter 2: Pithon
    1. 2.1 Objectives
    2. 2.2 What Is Pi?
    3. 2.3 More About the math Module
    4. 2.4 The Archimedes Approach
    5. 2.5 Accumulator Approximations
    6. 2.6 A Monte Carlo Simulation
    7. 2.7 Summary
  9. Chapter 3: Codes and Other Secrets
    1. 3.1 Objectives
    2. 3.2 Introduction
    3. 3.3 Encoding and Decoding Messages
    4. 3.4 Transposition Cipher
    5. 3.5 Substitution Cipher
    6. 3.6 Creating a Key
    7. 3.7 The Vignère Cipher
    8. 3.8 Summary
  10. Chapter 4: A Nest of Snakes: Introducing the Python Collections
    1. 4.1 Objectives
    2. 4.2 What Is Data?
    3. 4.3 Storing Data for Processing
    4. 4.4 Simple Dispersion
    5. 4.5 Central Tendency
    6. 4.6 Frequency Distribution
    7. 4.7 Dispersion: Standard Deviation
    8. 4.8 Summary
  11. Chapter 5: Earthquakes, Floods, and Other Natural Disasters
    1. 5.1 Objectives
    2. 5.2 Using Files for Large Data Sets
    3. 5.3 Reading Data from the Internet
    4. 5.4 Summary
  12. Chapter 6: Pycture Perfect Programs
    1. 6.1 Objectives
    2. 6.2 What Is Digital Image Processing?
    3. 6.3 Basic Image Processing
    4. 6.4 Parameters, Parameter Passing, and Scope
    5. 6.5 Advanced Image Processing
    6. 6.6 Summary
  13. Chapter 7: Data Mining: Cluster Analysis
    1. 7.1 Objectives
    2. 7.2 What Is Data Mining?
    3. 7.3 Cluster Analysis: A Simple Example
    4. 7.4 Implementing Cluster Analysis on Simple Data
    5. 7.5 Implementing Cluster Analysis: Earthquakes
    6. 7.6 Cluster Analysis Shortcomings and Solutions
    7. 7.7 Summary
  14. Chapter 8: Cryptanalysis
    1. 8.1 Objectives
    2. 8.2 Introduction
    3. 8.3 Cracking the Rail Fence
    4. 8.4 Cracking the Substitution Cipher
    5. 8.5 Summary
  15. Chapter 9: Fractals: The Geometry of Nature
    1. 9.1 Objectives
    2. 9.2 Introduction
    3. 9.3 Recursive Programs
    4. 9.4 Snowflakes, Lindenmayer, and Grammars
    5. 9.5 Summary
  16. Chapter 10: Astronomy
    1. 10.1 Objectives
    2. 10.2 Introduction
    3. 10.3 Designing and Implementing a Planet Class
    4. 10.4 Designing and Implementing a Sun Class
    5. 10.5 Designing and Implementing a Solar System
    6. 10.6 Animating the Solar System
    7. 10.7 Summary
  17. Chapter 11: Bears, Fish, and Plants, Oh My!
    1. 11.1 Objectives
    2. 11.2 Bears and Fish
    3. 11.3 What Is a Simulation?
    4. 11.4 Rules of the Game
    5. 11.5 Design
    6. 11.6 Implementation
    7. 11.7 Growing Plants
    8. 11.8 A Note on Inheritance
    9. 11.9 Summary
  18. Chapter 12: Your Father Was a Rectangle
    1. 12.1 Objectives
    2. 12.2 Introduction
    3. 12.3 First Design
    4. 12.4 Basic Implementation
    5. 12.5 Understanding Inheritance
    6. 12.6 Limitations
    7. 12.7 An Improved Implementation
    8. 12.8 Implementing Polygons
    9. 12.9 Summary
  19. Chapter 13: Video Games
    1. 13.1 Objectives
    2. 13.2 Introduction
    3. 13.3 Event-Driven Programming with turtle
    4. 13.4 Creating Your Own Video Game
    5. 13.5 Summary
  20. Appendix A: Installing the Required Software
  21. Appendix B: Python Quick Reference
  22. Appendix C: turtle Reference
  23. Index