Want Sweet Deals? Join our Mailing List

Learn to Code by Solving Problems

A Python Programming Primer

By Daniel Zingaro

Clear

Learn to Code by Solving Problems is a beginner's book that uses coding-competition challenges to teach you how to write programs in Python.

Description

Download Chapter 2: MAKING DECISIONS

Supplementary resources for the book, including downloadable code and additional exercises available here.

Computers are capable of solving almost any problem when given the right instructions. That’s where programming comes in. This beginner’s book will have you writing Python programs right away. You’ll solve interesting problems drawn from real coding competitions and build your programming skills as you go.

Every chapter presents problems from coding challenge websites, where online judges test your solutions and provide targeted feedback. As you practice using core Python features, functions, and techniques, you’ll develop a clear understanding of data structures, algorithms, and other programming basics. Bonus exercises invite you to explore new concepts on your own, and multiple-choice questions encourage you to think about how each piece of code works.

You’ll learn how to:

  • Run Python code, work with strings, and use variables
  • Write programs that make decisions
  • Make code more efficient with while and for loops
  • Use Python sets, lists, and dictionaries to organize, sort, and search data
  • Design programs using functions and top-down design
  • Create complete-search algorithms and use Big O notation to design more efficient code

By the end of the book, you’ll not only be proficient in Python, but you’ll also understand how to think through problems and tackle them with code. Programming languages come and go, but this book gives you the lasting foundation you need to start thinking like a programmer.

DETAILS

June 2021, 336 pp.
ISBN-13: 9781718501324

TABLE OF CONTENTS

Acknowledgements
Introduction
Chapter 1: Getting Started
Chapter 2: Making Decisions
Chapter 3: Repeating Code: Definite Loops
Chapter 4: Repeating Code: Indefinite Loops
Chapter 5: Organizing Values Using Lists
Chapter 6: Designing Programs with Functions
Chapter 7: Reading and Writing Files
Chapter 8: Organizing Values Using Sets and Dictionaries
Chapter 9: Designing Algorithms with Complete Search
Chapter 10: Big O and Program Efficiency
Afterword

View the Copyright Page</b
View the detailed Table of Contents
View the Index

AUTHOR BIO

Dr. Daniel Zingaro is an award-winning Associate Professor of Computer Science in the teaching stream at University of Toronto Mississauga, and is internationally recognized for his expertise in Active Learning. He is also the author of Algorithmic Thinking (No Starch Press, 2021).

UPDATES

Click here to download the latest errata

REVIEWS

“The book is an exceptionally well-written technical Python book for beginners that uses active learning techniques. If you’re a beginner to intermediate-level coder, this book will significantly improve your Python skills. It’s easy to read, and solving the problems is fun and satisfying.”
—Christian Mayer, Finxter

“For someone just learning to program, or learning Python after spending some time with another language, Learn to Code by Solving Problems covers what a programmer needs to know to get started with the language, plus language-independent skills like breaking a solution into parts using functions”
—Duncan Smith, Red-Green-Code

You Might Also Like

Newsletter Subscription

We’ll send you sweet deals on upcoming books and let you know when new books are released. We’ll never sell, give away, or use your personal information for nefarious purposes. Choose the categories you’re interested in (check as many as you’d like):