Introduction to Programming (CS101)

Fall 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 60~120 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 five 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


CS101 grading consists of two parts: practice and theory.

Practice points are collected as follows:

Students need to collect at least 320 practice points. Students who missed too many practice points can earn additional practice points using an extra (bonus) homework at the end of the semester.

Theory points are collected as follows:

The final score for CS101 is determined entirely by the theory points, (but students who did not earn 320 practice points receive a fail grade).

Repeating students: Students who have already taken advanced courses involving programming, and all students who are majoring in the College of Information Science & Technology cannot retake CS101 if they have already passed CS101. (This automatically applies to all students who have a major in the Depts. of Electrical Engineering, Computer Science, Information & Communications Engineering, Industrial & Systems Engineering, Knowledge Service Engineering, and Industrial Design.)

All repeating students cannot receive a grade better than B+ by KAIST policy (and this applies even to students who entered KAIST before 2007).

Pass exam

In the first week of the semester we offer a "Pass Exam", which students who have already learnt programming can take to fulfill the CS101 requirement.

The pass exam consists of a 90 minutes written exam, followed by a 90 minute programming exam.

The written exam is closed book, and covers programming in Python as taught in CS101, but without the cs1robots, cs1media, and cs1graphics modules.

The programming exam is open book (only printed material). You use a computer in the lab room, but will have access only to the Wing or IDLE environment (no internet access).

If you pass the exam with a B- or better, you can choose to accept the score as your CS101 score, or to give up the score and take the CS101 class.


CS101 uses the following materials:

The slides used in the lectures will also be available online, and there will be slides for every lab session.


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 Why learn programming? What is computational thinking? Syntax, functions, for-loops No lab
Week 2 First objects, conditionals, while-loops Install software, programming with robots: (basic Python syntax, for-loops)
Week 3 Variables, basic data types More programming with robots (Conditionals, while-loops)
Week 4 No class, no lab (Chuseok week)
Week 5 Functions with parameters and return values Basic Python objects (numbers, strings, lists)
Week 6 Graphical objects, local variables Functions with parameters and return values
Week 7 Sequences: lists, strings, tuples Create graphical display (practice objects)
Week 8 Midterm exam No lab
Week 9 Image processing Practice lists and tuples
Week 10 Text files Image processing
Week 11 Case studies Process text data from the web
Week 12 User-defined objects More examples
Week 13 More objects (magic methods) Using objects
Week 14 Speed, compilers and interpreters, algorithms Graphical animal
Week 15 Reserve Reserve
Week 16 Final Exam No lab

Slides and example code

All slides and example code used in the class are available here.


Some useful materials:

Otfried Cheong