ENGLISH

Learn to Code by Solving Problems. A Python Programming Primer

Book information

Publisher
No Starch Press
Year
2021
ISBN
9781718501324, 9781718501331, 2021011082, 2021011083
Language
english
Format
PDF
Filesize
2 MB (2290444 bytes)
Edition
1
Pages
\413
Time added
2022-01-02 13:43:00

Description

Title Page Copyright Page Dedication About the Author About the Technical Reviewer BRIEF CONTENTS CONTENTS IN DETAIL ACKNOWLEDGMENTS INTRODUCTION Online Resources Who This Book Is For Why Learn Python? Installing Python How to Read This Book Using Programming Judges Making Your Programming Judge Accounts About This Book 1 GETTING STARTED What We’ll Be Doing The Python Shell Problem #1: Word Count Strings Integer and Floating-Point Numbers Counting the Words Using a Variable Reading Input Writing Output Solving the Problem: A Complete Python Program Problem #2: Cone Volume More Math in Python Converting Between Strings and Integers Solving the Problem Summary Chapter Exercises Notes 2 MAKING DECISIONS Problem #3: Winning Team Conditional Execution The Boolean Type Relational Operators The if Statement Solving the Problem Problem #4: Telemarketers Boolean Operators Solving the Problem Comments Input and Output Redirection Summary Chapter Exercises Notes 3 REPEATING CODE: DEFINITE LOOPS Problem #5: Three Cups Why Loops? for Loops Nesting Solving the Problem Problem #6: Occupied Spaces A New Kind of Loop Indexing Range for loops Range for Loops Through Indices Solving the Problem Problem #7: Data Plan Looping to Read Input Solving the Problem Summary Chapter Exercises Notes 4 REPEATING CODE: INDEFINITE LOOPS Problem #8: Slot Machines Exploring a Test Case A Limitation of for loops while loops Solving the Problem The Mod Operator F-Strings Problem #9: Song Playlist String Slicing Solving the Problem Problem #10: Secret Sentence Another Limitation of for loops while Loops Through Indices Solving the Problem break and continue Summary Chapter Exercises Notes 5 ORGANIZING VALUES USING LISTS Problem #11: Village Neighborhood Why Lists? Lists List Mutability Learning About Methods List Methods Solving the Problem Avoiding Code Duplication: Two More Solutions Problem #12: School Trip Splitting Strings and Joining Lists Changing List Values Solving Most of the Problem How to Handle the Catch Problem #13: Baker Bonus Representing a Table Solving the Problem Summary Chapter Exercises Notes 6 DESIGNING PROGRAMS WITH FUNCTIONS Problem #14: Card Game Exploring a Test Case Defining and Calling Functions Function Documentation Solving the Problem Problem #15: Action Figures Representing the Boxes Top-Down Design Summary Chapter Exercises Notes 7 READING AND WRITING FILES Problem #16: Essay Formatting Working with Files Solving the Problem Problem #17: Farm Seeding Exploring a Test Case Top-Down Design Summary Chapter Exercises Notes 8 ORGANIZING VALUES USING SETS AND DICTIONARIES Problem #18: Email Addresses Using a List Efficiency of Searching a List Sets Set Methods Efficiency of Searching a Set Solving the Problem Problem #19: Common Words Exploring a Test Case Dictionaries Indexing Dictionaries Looping Through Dictionaries Inverting a Dictionary Solving the Problem Problem #20: Cities and States Exploring a Test Case Solving the Problem Summary Chapter Exercises Notes 9 DESIGNING ALGORITHMS WITH COMPLETE SEARCH Problem #21: Lifeguards Exploring a Test Case Solving the Problem Problem #22: Ski Hills Exploring a Test Case Solving the Problem Problem #23: Cow Baseball Using Three Nested Loops Sorting First Python Modules The bisect Module Solving the Problem Summary Chapter Exercises Notes 10 BIG O AND PROGRAM EFFICIENCY The Problem with Timing Big O Problem #24: Longest Scarf Exploring a Test Case Algorithm 1 Algorithm 2 Problem #25: Ribbon Painting Exploring a Test Case Solving the Problem Summary Chapter Exercises Notes AFTERWORD APPENDIX: PROBLEM CREDITS INDEX

Similar books