intro to programming

Prerequisites: none.

Things you’ll learn

  • fundamentals of programming with Python
  • how to create simple text-based programs (about 50 lines long) from scratch
  • how to think like a programmer

Topics covered

  • console input/output
  • basic data types and manipulation (numbers, strings, booleans)
  • control structures (conditionals, loops, functions)
  • data structures and manipulation (lists, dictionaries)
  • file input/output
  • command line arguments
  • design and debugging techniques

This course uses procedural programming. Functional and object-oriented programming are covered in later courses.

Example programs

Notice that this is a text-based program. Most of the programs you’re used to using have a graphical user interface with buttons and images and things, but in this course we’ll just use this simpler text interface. The front-end web development course and the games course will introduce graphical user interfaces.

Resources

I’ve started writing my own intro to programming course which begins on the next page. You’re welcome to give it a try, but it won’t take you very far. I haven’t finished it yet. Fortunately, there are many free websites that can help you learn Python.

Code Academy and Code School have interactive lessons where you can type Python code into your web browser and see the results without having to install anything. If you like book learning, Think Python is available for free in PDF and HTML form. You can also get the dead-tree edition from Amazon. Sphere online judge has a bunch of programming challenges. You can submit solutions and then spoj will tell you if you did it correctly.

I recommend that you start with code academy. (If you feel like it, you could start with code school instead.) Books tend to have more in-depth information, but they can be a drag if you try to read them start to finish. You could switch back and forth between Think Python and the interactive courses so that you learn more stuff but don’t get bored. Solve some problems on Spoj along the way. It’ll be fun, and it’ll help you apply what you’re learning.

After you’ve been learning for a bit, see if you can create the high-low game shown in the video above. Think of that as a midterm exam. It requires knowledge of some (but not all) of the things you should learn in this course. Soon I’ll add a more advanced program for the “final exam.”


next: your first language