Introduction to Programming (CS101)

Spring Semester 2010

This course is aimed at students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, to feel justifiably confident of their ability to write small programs that allow them to accomplish useful goals. The class will use the Python programming language.

The objective of CS101 is to teach programming skills and computational thinking. The first is important because programming is needed in all areas of science and engineering, although very different programming languages are used. The second is perhaps even more important, as it influences how you go about solving a problem. 50 years ago, the solution to a problem in mathematics or engineering was often a formula. Today, it is usually an algorithm.

Starting from spring 2010, CS101 uses the programming language Python, a language that was designed to be easy to learn. Python is used by many universities world-wide for teaching introductory programming. It is free, open-source, and multi-platform.

Python is not a toy. Python is the basis for much of the programming at Google (for instance, Python is the original and main framework for the Google App Engine platform). Python is used intensively in numerical computations, for instance at NASA. The numerical Python library supports vectorization and is widely used in scientific computation. Python is also the language of choice for writing user interfaces for applications on high-end Nokia phones. Large portions of games (such as Civilization IV) are written in Python. Python is becoming the language of choice in mathematics, used for instance by graph algorithm libraries, or the open-source mathematics software system Sage (an open-source competitor to Maple or Mathematica).

CS101 consists of 12 sections of about 40 students each. Each section meets once a week for a three-hour lab session supervised by a lead TA (a Ph.D. student), with some helper TA's around (undergraduate and master students). Four sections take one lecture together, which is once a week for 75 minutes.

Students need to attend the lab session every week. One of the tasks done during the lab has to be marked off by a TA, so that we know that you were there and did your best.

There will also be about four take-home homeworks where you have to program slightly more complex tasks.

Lab sessions will introduce students to pair programming.

This webpage contains the syllabus, lecture notes, and slides for CS101, and links to all the software you need in the labs (or to do the lab tasks on your own computer).

All other information, such as lecturers, TAs, lecture and lab times, homeworks, exams, and the bulletin boards can be found on the comprehensive CS101 website

Learning C/C++/Java

If you decide to major in an engineering area such as computer science, mechanical engineering, electrical engineering, or industrial engineering, you will need to learn C++ (for computer science) or at least C. You may also want to learn Java.

We will offer some short introduction to C during this course. Having learnt to program well in Python, this will be rather easy to do. (In fact, we believe that after having learnt the fundamentals well in Python, you will be a better C programmer than if you started learning to program in C.)

To further study C, C++, or Java, you could study those languages either by yourself, or by taking a course at the KAIST IT Academy. The CS department is also thinking about offering a 1-credit course teaching C++ programming in the winter break 2010/2011.


CS101 will use only freely available material:

The slides used in the lectures will also be available online.


We will make use of the following freely available software: Python 2.6, Wing IDE 101, Python Imaging Library (PIL),,, and

A copy of all necessary software and installation instructions will be available in the instructions for Lab 1.


Here is a rough list of what we will cover in each week of the semester.

  Lecture Lab session
Week 1 Course Introduction; Why learn programming? What is computational thinking? Algorithms No lab
Week 2 Syntax, functions, for-loops, first objects Install software, programming with robots: (basic Python syntax, for-loops)
Week 3 Conditionals, while-loops More programming with robots (Conditionals, while-loops)
Week 4 Variables, basic data types Basic Python objects (numbers, strings, lists)
Week 5 Objects, garbage collection Create graphical display (practice objects and basic data types)
Week 6 Lists and loops Animated graphics (practice loops)
Week 7 Images Image processing (practice loops and numerical computations )
Week 8 Midterm exam No lab
Week 9 Comparison of Python and C syntax More image processing
Week 10 Strings and text files Process text data from the web (practice working with strings)
Week 11 Dictionaries Text analysis (practice working with strings and dictionaries)
Week 12 User-defined objects Parameterized graphical objects
Week 13 Exceptions Numeric integration
Week 14 Programming in C First programs in C
Week 15 Programming in C C programming
Week 16 Final Exam No lab


Some useful materials:

Otfried Cheong