<b><i>Learn to Code by Solving Problems </i>isΒ a practical introduction to programming using Python. It uses coding-competition challenges to teach you the mechanics of coding and how to think like a savvy programmer.</b> Computers are capable of solving almost any problem when given the right in
Learn to Code by Solving Problems. A Python Programming Primer
β Scribed by Daniel Zingaro; Safari, an O'Reilly Media Company.
- Publisher
- No Starch Press
- Year
- 2021
- Tongue
- English
- Leaves
- 413
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Table of Contents
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 VOLUMES
<div> <p><span style="font-weight: bold; font-style: italic">Learn to Code by Solving Problems</span><strong> is a practical introduction to programming using Python. It uses coding-competition challenges to teach you the mechanics of coding and how to think like a savvy programmer.</strong> </p>
Learn to Code by Solving Problems is a practical introduction to programming using Python. It uses coding-competition challenges to teach you the mechanics of coding and how to think like a savvy programmer. Computers are capable of solving almost any problem when given the right instructions. Thatβ
<h2><span>The world of Python programming is booming! Get a slice of the action.</span></h2><p><span>Have you always wanted to be a part of the programming world, but things seem confusing and complicated so youβve never gone through with it? </span></p><p><span>Are you hoping to get a career in pro