𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Python Programming in Context, Fourth Edition

✍ Scribed by Julie Anderson and Jon Anderson


Publisher
Jones & Bartlett Learning
Year
2024
Tongue
English
Leaves
500
Edition
4
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Python Programming in Context, Fourth Edition provides a comprehensive and accessible introduction to Python fundamentals. Updated with Python 3.10, the Fourth Edition offers a thorough overview of multiple applied areas, including image processing, cryptography, astronomy, the Internet, and bioinformatics. Taking an active learning approach, each chapter starts with a comprehensive real-world project that teaches core design techniques and Python programming to immediately engage students. An ideal first language for learners entering the rapidly expanding fields of computer science, data science, and scientific programing, Python gives students a solid platform of key problem-solving skills that translate easily across programming languages. This text is designed to be a first course in computer science that focuses on problem-solving, with language features being introduced as needed to solve the problem at hand.

✦ Table of Contents


Cover
Title Page
Copyright Page
Dedication Page
Brief Contents
Contents
Preface
Acknowledgments
CHAPTER 1 Introduction to Python
1.1 Objectives
1.2 What Is Computer Science?
1.3 Why Study Computer Science?
1.3.1 Everyday Applications of Computer Science
1.3.2 Why Computer Science Is Important
1.4 Problem-Solving Strategies
1.5 Python Overview
1.5.1 Primitive Elements
1.5.2 Naming Objects
1.5.3 Abstraction
1.5.4 Repetition
1.6 Summary
Key Terms
Programming Exercises
CHAPTER 2 Playing by the Rules
2.1 Objectives
2.2 The Chatbot
2.3 The String Data Type
2.4 Making Decisions
2.4.1 Boolean Expressions
2.4.2 Compound Boolean Expressions and Logical Operators
2.4.3 Selection Statements
2.5 Implementing the Chatbot
2.6 Playing Games
2.6.1 Guess a Number
2.6.2 The while Loop
2.6.3 Printing Numbers in Strings
2.6.4 Asking for Input
2.7 Completing Guess a Number
2.8 Validating User Input
2.9 Counting the Guesses
2.9.1 The Accumulator Pattern
2.10 The Game of Nim
2.10.1 Random Numbers
2.10.2 Returning a Value from a Function
2.11 Summary
Key Terms
Programming Exercises
CHAPTER 3 Codes and Other Secrets
3.1 Objectives
3.2 The String Data Type
3.2.1 Repetition
3.2.2 Indexing
3.2.3 String Slicing
3.2.4 String Searching
3.2.5 String Methods
3.2.6 Character Functions
3.3 Encrypting and Decrypting Messages
3.4 Transposition Cipher
3.4.1 Encrypting Using Transposition
3.4.2 Decrypting a Transposed Message
3.5 Substitution Cipher
3.6 Creating a Key
3.7 The Vigenère Cipher
3.8 Summary
Key Terms
Programming Exercises
CHAPTER 4 Introducing the Python Collections
4.1 Objectives
4.2 What Is Data?
4.3 Storing Data for Processing
4.3.1 Strings Revisited
4.3.2 Lists
4.4 Calculating Statistics on Data
4.4.1 Simple Dispersion
4.5 Central Tendency
4.5.1 Mean
4.5.2 Median
4.5.3 Mode
4.6 Frequency Distribution
4.6.1 Using a Dictionary to Compute a Frequency Table
4.6.2 Computing a Frequency Table Without a Dictionary
4.6.3 Visualizing a Frequency Distribution
4.7 Dispersion: Standard Deviation
4.8 Summary
Key Terms
Programming Exercises
CHAPTER 5 Bigger Data: File I/O
5.1 Objectives
5.2 Using Files for Large Data Sets
5.2.1 Text Files
5.2.2 Iterating over Lines in a File
5.2.3 Writing a File
5.2.4 String Formatting
5.2.5 Alternative File-Reading Methods
5.3 Reading Data from the Internet
5.3.1 Using CSV Files
5.3.2 Using a while Loop to Read a File
5.3.3 List Comprehension
5.4 Reading and Manipulating Data with pandas
5.4.1 pandas Data Structures
5.4.2 Reading CSV Data with pandas
5.4.3 Data Manipulation with pandas
5.5 Reading JSON Data from the Internet
5.6 Correlating Data
5.7 Summary
Key Terms
Programming Exercise
CHAPTER 6 Image Processing
6.1 Objectives
6.2 What Is Digital Image Processing?
6.2.1 The RGB Color Model
6.2.2 The cImage Module
6.3 Basic Image Processing
6.3.1 Negative Images
6.3.2 Grayscale
6.3.3 A General Solution: The Pixel Mapper
6.4 Parameters, Parameter Passing, and Scope
6.4.1 Call by Assignment Parameter Passing
6.4.2 Namespaces
6.4.3 Calling Functions and Finding Names
6.4.4 Modules and Namespaces
6.5 Advanced Image Processing
6.5.1 Resizing
6.5.2 Stretching: A Different Perspective
6.5.3 Flipping an Image
6.5.4 Edge Detection
6.6 Summary
Key Terms
Programming Exercises
CHAPTER 7 Data Mining: Cluster Analysis
7.1 Objectives
7.2 What Is Data Mining?
7.3 Cluster Analysis: A Simple Example
7.4 Implementing Cluster Analysis on Simple Data
7.4.1 Distance Between Two Points
7.4.2 Clusters and Centroids
7.4.3 The K-Means Cluster Analysis Algorithm
7.4.4 Implementation of K-Means
7.4.5 Implementation of K-Means, Continued
7.5 Implementing Cluster Analysis: Earthquakes
7.5.1 File Processing
7.5.2 Visualization
7.6 Cluster Analysis Shortcomings and Solutions
7.7 Summary
Key Terms
Programming Exercises
CHAPTER 8 Cryptanalysis
8.1 Objectives
8.2 Introduction
8.3 Cracking the Rail Fence
8.3.1 Checking Our Work with a Dictionary
8.3.2 A Brute-Force Solution
8.3.3 A Rail Fence Decryption Algorithm
8.4 Cracking the Substitution Cipher
8.4.1 Letter Frequency
8.4.2 Ciphertext Frequency Analysis
8.4.3 Letter Pair Analysis
8.4.4 Word Frequency Analysis
8.4.5 Pattern Matching with Partial Words
8.4.6 Regular Expression Summary
8.5 Summary
Key Terms
Programming Exercises
CHAPTER 9 Fractals: The Geometry of Nature
9.1 Objectives
9.2 Introduction
9.3 Recursive Programs
9.3.1 Recursive Squares
9.3.2 Classic Recursive Functions
9.3.3 Drawing a Recursive Tree
9.3.4 The Sierpinski Triangle
9.3.5 Call Tree for a Sierpinski Triangle
9.4 Snowflakes, Lindenmayer, and Grammars
9.4.1 L-Systems and the match Statement
9.4.2 Automatically Expanding Production Rules
9.4.3 More Advanced L-Systems
9.5 Summary
Key Terms
Programming Exercises
CHAPTER 10 Planet Objects
10.1 Objectives
10.2 Introduction
10.2.1 Focusing on Data
10.2.2 Object-Oriented Programming
10.2.3 Python Classes
10.3 Designing and Implementing a Planet Class
10.3.1 Constructor Method
10.3.2 Accessor Methods
10.3.3 Mutator Methods
10.3.4 Special Methods
10.3.5 Methods and self
10.3.6 Details of Method Storage and Lookup
10.4 Designing and Implementing a Sun Class
10.5 Designing and Implementing a Solar System
10.6 Animating the Solar System
10.6.1 Using Turtles
10.6.2 Planetary Orbits
10.6.3 Implementing the Simulation
10.7 Summary
Key Terms
Programming Exercises
CHAPTER 11 Simulation
11.1 Objectives
11.2 Bears and Fish
11.3 What Is a Simulation?
11.4 Rules of the Game
11.5 Design
11.6 Implementation
11.6.1 The World Class
11.6.2 The Fish Class
11.6.3 The Bear Class
11.6.4 Main Simulation
11.7 Growing Plants
11.8 A Note on Inheritance
11.9 Summary
Key Terms
Programming Exercises
CHAPTER 12 A Hierarchy of Shapes
12.1 Objectives
12.2 Introduction
12.3 First Design
12.4 Basic Implementation
12.4.1 The Canvas Class
12.4.2 The GeometricObject Class
12.4.3 The Point Class
12.4.4 The Line Class
12.4.5 Testing Our Implementation
12.5 Understanding Inheritance
12.6 Limitations
12.7 An Improved Implementation
12.8 Implementing Polygons
12.9 Summary
Key Terms
Programming Exercises
CHAPTER 13 Interactive Games
13.1 Objectives
13.2 Introduction
13.2.1 Event-Driven Programming
13.2.2 Simulating an Event Loop
13.2.3 A Multithreaded Event Loop
13.3 Event-Driven Programming with the Turtle
13.3.1 A Simple Drawing Using Key Presses
13.3.2 Placing Turtles Using Mouse Clicks
13.3.3 Bouncing Turtles
13.4 Creating Your Own Video Game
13.4.1 The LaserCannon Class
13.4.2 The BoundedTurtle Class
13.4.3 The Drone Class
13.4.4 The Bomb Class
13.4.5 Putting All the Pieces Together
13.5 Summary
Key Terms
Programming Exercises
Appendix A: Installing the Required Software
Appendix B: Python Quick Reference
Appendix C: turtle Reference
Appendix D: Answers to Selected Try It Out Exercises
Glossary
Index


πŸ“œ SIMILAR VOLUMES


cover
✍ Miller, Bradley N., author πŸ“‚ Library πŸ“… 2021 πŸ› Burlington, Massachusetts : Jones & Bartlett Learn 🌐 English

1 online resource

Programming in Lua, fourth edition
✍ Roberto Ierusalimschy πŸ“‚ Library πŸ“… 2016 πŸ› Lua.Org 🌐 English

<span>Lua is spreading more and more throughout different areas of software, from embedded systems and mobile devices to the Web and the Internet of Things. Besides, it has a major role in the game industry, where knowledge of Lua has become an indisputable asset. Lua is the language of choice for a