Section outline

  • It’s easier to learn how to program a computer today than it has ever been before. Now everyone can learn to write programs - no previous experience is necessary. All you need to learn how to program is a computer running a current browser and an Internet connection. Programming is fun and a a rewarding thing to learn.

    Guests can not take part in the interactive exercises. To take part in them get a test username and a password from README.txt. For all potential teachers the README.txt is a must!

     
    Offered to the community by EduNET.LK under CC-BY-SA
  • Computer programs have evolved from mathematics. But unlike in mathematics computer programs are written in pure text. As a result you have to write \( \frac{a}{2} \) or \( \sqrt{x + 1} \) as a/2 or sqrt(x + 1).

    • 1.1 Quiz: Numerical expressions
      Not available unless: The activity (Missing activity) is marked complete
    • 1.2 Quiz: Expressions with variables
      Not available unless: The activity 1.1 Quiz: Numerical expressions is marked complete
    • 1.3 Recording of the live-session 1 URL
      Not available unless: The activity (Missing activity) is marked complete
    • 1.4 Slides of the live-session 1 File
      Not available unless: The activity (Missing activity) is marked complete
    • 1.5 Quiz: Expanding expressions
      Not available unless: The activity 1.2 Quiz: Expressions with variables is marked complete
    • 1.6 Quiz: Revision
      Not available unless: The activity 1.5 Quiz: Expanding expressions is marked complete
  • Programming is all about moving and transforming data. During this process you need to store information in "containers" to fetch them later. These containers are the variables. The assignment operator '=' assigns values to variables. To interact with the real world the programs also need mechanisms to read information, called input and a way to bring the results out, called output.

    Language elements: =print | input | int | float

  • The "programs" in unit 2 were linear; but real programs need to make decisions. Selection statements  allow your code to branch off in different directions based on specific conditions. If a certain condition is met, the program does one thing; if not, it does something different.

    Language elements: ifelif | else | match | case

  • Computers are famous for being able to do repetitive tasks without getting bored. Loops allow you to run the same block of code multiple times. Whether you want to repeat a task a set number of times (for loop) or keep going until a specific goal is reached (while loop), loops are the key to repetition.

  • As your code grows, it can become messy. Subprograms (also called Functions or Methods) allow you to group blocks of code together and separate them with an own name. This makes your code modular, easier to read, and allows you to reuse the same code throughout your program without rewriting.

    • Upload a soft copy of your handwritten summary before coming to the exam. The summary must contain your name and the sentence, "I made this document on my own, in my own handwriting." at the top.

      The preferred format is PDF - not images (photos). We recommend CamScanner to make the PDFs.

      For ideas on its usefulness, watch: The top 1% Think on Paper. Here’s How To Do It

    • Final exam Quiz
      Opens: Saturday, 18 July 2026, 11:59 PM
      Closes: Monday, 20 July 2026, 11:59 PM
      Not available unless: The activity Your handwritten summary is marked complete
    • Slides of the closing.. File
      Not available unless: The activity Course evaluation is marked complete
    • Participants offer their course summaries Forum
      Not available unless: The activity 1.5 Quiz: Expanding expressions is marked complete