Skip to content

| Table of Contents | Next: 02 - Getting Started


1 - Introduction and How to Use this Book

Introduction

Python changed my life. Before learning Python, computers intimidated me. Python opened up to me a world of programming that made computers into useful tools instead of necessary evils. Regardless of the reason you are reading this book right now, I hope that Python will have a similar impact on you.

I am writing this book to introduce Python to newcomers to programming. If you are an experienced programmer and are looking to add Python to your repertoire, this may not be the book for you. The intent of this book is, primarily, to give a solid introduction to Python, and some introductory computer science, to those who are completely new to programming.

To that end, I have the following goals in mind while writing this book:

  • Make a free Python resource

    I want to make a resource that will be free (as in free beer and free speech) forever so that any student of Python may have access to these introductory materials. Anyone can learn to program in Python and programming should not be a skill that is forever behind a pay wall.

  • Teach computer science fundamentals

    Computer fundamentals is an area of understanding that is often neglected when teaching Python. In my experience, understanding these fundamentals helps you write better code more quickly and, when things go wrong, fixing your code is easier to do.

  • Allow the reader to learn at their own pace

    I attempt to structure the experience of this book such that you can learn at your own pace. After covering a particular skill or subject, you can move on quickly to the next exercise or, if desired, you can do more to hone your skills and master the subject. This philosophy of learning will hopefully facilitate the depth of your learning. Also, this allows you to pursue your specific interests and flesh out your skill set in a way that benefits you the most.

How to use this book

In this book, I aim to get you coding ASAP and constantly encourage you to try things yourself. You will learn a lot more actually attempting to write code than you will reading about it. With that said, there are some things you should know before beginning.

You MUST do some boring stuff BEFORE you can do interesting stuff

In the 1984 film "The Karate Kid", Mr. Miyagi, the teacher, doesn't start training Daniel, the protagonist, in Karate by teaching him fancy moves but instead begins by having him perform many menial tasks with no apparent point to them. It is in doing these seemingly pointless tasks that Daniel first begins to have skill in Karate.

Anytime you learn a new skill you must do many boring and seemingly pointless things before you can do something interesting or useful. Every discipline has this feature. I am telling you this because for me, a person with a very limited attention span, the beginning of learning programming was agonizingly slow and seemingly pointless. You may feel that way too.

However, if you will do the following simple things in every section you will be well on your way:

  1. Read the section
  2. Write the code from each section code EXACTLY as it is written without copy-pasting it
  3. Make it run
  4. Understand what the code you wrote does

When things get boring or tedious, remember the Karate Kid. You are building a foundation on which you can move mountains. In addition, each section can include some features that will enhance your ability.

What is in each section?

In each section of this book, reading and exercises will be ordered by how mandatory they are. If you wish to move as quickly as possible, you may only do the first part of each section where I will cover the essential material. However, I do recommend doing everything under "Hone Your Skills" in every section to get the most out of this book.

The sections generally will be divided in to 3 subsections. Each of these sections has a distinct purpose. Depending on your level of skill and interest there are a number of ways of approaching each section. They are as follows:

  • Reading and basic exercises

This will be the main content of each section and is mandatory as you learn. It will include a relatively short introduction on the subject of each section and provide exercises intended to get you reasonably competent in a particular concept or skill. Once you have completed this subsection, you may move on to the next section with confidence that you have gotten the essential parts of the section.

  • Hone Your Skills

This subsection will include more challenging exercises designed to push you to find applications of the skill or concept in each section. If you feel weak on a particular topic, these sections provide a way to deepen your understanding and ensure you 'own' the concepts in each section.

One of the most important skills you can learn is how to find answers for yourself. To that end, do not be surprised if some of the exercises ask you to go and research something yourself. Included in these subsections will be some extra information or directions to resources online and elsewhere that are intended to help you understand each concept more fully.

  • Advanced Mastery

These sections may not be included in every section. However, I have added these subsections whenever I feel there are some deeper things to learn or some principles that will serve you as you master programming. These sections may involve concepts we have not covered yet as well so if you get to a point where you feel lost, just skip it and come back to it later.

This book is intended to serve you and not the other way around. Therefore, I recommend you do the reading and basic exercises of each section. Beyond that, you are free to pursue what interests you and skip anything that doesn't. There are multiple ways to approach learning but one way is to do the "Reading and basic exercises" from each section first and then add to your knowledge with the other two subsections.

Defining Terms

We will introduce several terms throughout this book with which you may be unfamiliar. Where this is the case, you may view a definition of the word or phrase by hovering your mouse cursor over the word or phrase in bold (e.g. here is the definition of Python)

Learning to feed yourself

I will sometimes have you read The Official Python Documentation, visit other websites or resources, or have you use an internet search engine to learn about a particular topic. I do this for a number of reasons but most importantly, I want you to be able to teach yourself everything this book cannot. It would be my goal that, after you have read and learned everything in this book, you can put it down and never pick it up again because you have learned how to find answers to your own questions. Doing this will make you that much more effective as a programmer and more effective as a human being in general.

Remember: Whenever I tell you to search for something on the Internet, remember that the best way to use a search engine is to type "Python" and then write what you are looking for. This will be a boon to your learning as you go along.


| Table of Contents | Next: 02 - Getting Started