The Explainer's Guide to Computer Programming

The Explainer's Guide to Computer Programming

About the Book

Computers are everywhere, from obvious ones like those on our desks and in our phones to less obvious ones like those in our cars and washing machines. We use computers daily, but often in the way we use a microwave; we know how to use it, but we have no solid concept of what goes on under the hood.

We may be aware that computers are general-purpose machines, that they can be instructed to act in different ways. The same general computer architecture, for example, controls your television, microwave, and car. What’s different between these examples, at a superficial level, is the program, the set of instructions telling the computer how to interact with its environment.

Therefore, computer programming, the act of instructing a computer to perform a task, is the key that makes computers useful. Change the instructions while keeping the machine the same, and you go from a web browser to a word processor to a video game.

This book is for everyone who wants to learn more about what goes on under the computer’s hood and how to harness that power for your own purposes. If you are curious about how computers are controlled, this book is for you. All you need to bring to the table is your curiosity.

This book introduces the core concepts behind computer programming. By the end of the book, you’ll know the following:

  • What are the major components of a computer system.
  • What it means to program a computer using a programming language.
  • How the five fundamental control structures work.
  • How to write computer programs in Python, a popular programming language.

About This Series

The Explainer’s Guides introduce readers to the fundamentals of each topic. No prior knowledge is assumed. The books are written by knowledgeable people and are intended primarily for adults seeking an introduction to the topic. The books are self-contained, and each book concludes by pointing the reader to additional material.

About the Author

Ronald T. Kneusel
Ronald T. Kneusel

My infatuation with computers began in 1981 with an Apple II. I've been active in machine learning since 2003, and deep learning since before AlexNet was a thing.

My background includes a Ph.D. in computer science from the University of Colorado, Boulder (deep learning), and an M.S. in physics from Michigan State University. By day, I work in industry building deep learning systems. By night, I type away on my keyboard generating books.

Please see my full list of books at www.rkneusel.com.

Table of Contents

  • 1. What Is A Computer?
    • 1.1. The CPU
    • 1.2. Memory
    • 1.3. Input and Output
    • 1.4. Storage
    • 1.5. Putting the Pieces Together
  • 2. What is Programming?
    • 2.1. What Do Programs Look Like?
    • 2.2. Thinking Like A Programmer
  • 3. Control Structures
    • 3.1. Sequence
    • 3.2. Conditionals
    • 3.3. Loops
    • 3.4. Functions
    • 3.5. Recursion
  • 4. Data and Data Structures
    • 4.1. Variables and Computers
    • 4.2. Numbers
    • 4.3. Arrays
    • 4.4. Records
    • 4.5. Advanced Data Structures
  • 5. Introducing Python
    • 5.1. This is the (Python) Way
    • 5.2. Using Python
    • 5.3. Numbers
    • 5.4. Strings
    • 5.5. Lists and Tuples
    • 5.6. Dictionaries
    • 5.7. Output and Input
    • 5.8. Things to Try
  • 6. Python in Action
    • 6.1. Bronze
      • 6.1.1. 99 Bottles on the Wall
      • 6.1.2. Palindromes
      • 6.1.3. It's Unique
      • 6.1.4. Flippin' Fun
    • 6.2. Silver
      • 6.2.1. Day of the Week
      • 6.2.2. Rock, Paper, Scissors
      • 6.2.3. Pi, Anyone?
    • 6.3. Gold
      • 6.3.1. Letter Frequencies
      • 6.3.2. Caesar's Cipher
      • 6.3.3. The Monty Hall Dilemma
  • 7. What's Next?
    • 7.1. Installing Python
    • 7.2. Topics in Computer Science
    • 7.3. Books
    • 7.4. Online Learning
    • 7.5. The End

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub