^ The links provided under Materials are only the beginning sections. Click on right arrow at the bottom of the page to go to the next sections.
Week
Topics
General Topic
By the end of the lessons, students should be able to:
1
S1: Introduction to Course and Python
S2: Variables and Basic data types
S3: Analysing problems and flowchart

  • install Python
  • State different data types
  • Check data type by calling a function
  • Assign and use variables
  • Identify keywords in Python
  • display variables, expressions, etc on to the screen using print
  • Use operators in expressions
  • State the order of operations given an expression
  • Create and use simple operations on String
  • Create comments in script mode
  • State input, output, and computation process given a problem description
  • Write Pseudocode for three basic structures for sequential, branch, and iterative structure
  • Explain the meaning of statement x=x+1
  • (* Draw three basic flowcharts for sequential, branch, and iterative)
  • (* State difference between Python 2 and 3 for print and integer division)
  • Identify custom data type created using class
2
S1: Problem solving framework
S2: Introduction to Function
S3: 1D Mini Projects

  • State and apply the problem solving framework: Problem Analysis (P), Test Cases (C), Design Algorithm (D), Implementation (I), Testing (T)
  • Convert from one data type to another using functions
  • Import and call Mathematics functions
  • Get input from keyboard using input() or raw_input()
  • Create a function definition and make a function call
  • Create and call functions with parameters
  • Create functions with return values and None
  • Explain local variables within a function

  • Use string formatting
  • (*Explain the difference between using "import" and "from _ import" for importing modules)
  • Create a custom data type using class with attributes
  • Create an instance of a class
  • Assign values to object's attributes
  • Access the values of the object's attributes

S1: Conditionals
S2: While-Loop
S3: Introduction to Set and List + 1D Mini Projects

  • Evaluate Boolean expressions
  • Evaluate three Logical operators (and, or, not)
  • Implement branch flowchart using if-else statement
  • Implement nested conditionals using if-else statement
  • Implement iterative flowchart using while statement
  • Apply break inside while loop
  • Create List data structure
  • Traverse List using while loop and index

  • Use list operations such as + and *
  • Apply list slices to create a new list
  • Apply list operations such as append, extend, sort
  • Remove element from list using pop, del, and remove
4
S1: Set, List, Tuples and Dictionary
S2: For-Loop
S3: For-Loop + 1D Mini Project

  • Create a nested list
  • Discuss similarity and differences between list and dictionary
  • Create dictionary data structure
  • Lookup value given a key of a dictionary
  • Reverse lookup a key given a value in a dictionary
  • Implement iterative flowchart using for-loop
  • Traverse list and dictionary using for-loop
  • Discuss differences between list, dictionary, set, and tuples
  • Use tuples as return values of functions and element of list or dictionary
  • (*Discuss aliasing and draw environment diagram of a list object)
5
S1: Modularity and Functions
S2: Solving more complex problems
S3: 1D Mini Project 4

  • Divide complex problems into smaller problems implemented in functions
  • Discuss return values of functions and its difference with print statement
  • Develop solutions and test them incrementally
  • (* Solve complex problem using recursion)
  • (* Discuss the difference between recursion and iterative solution)
  • (* Write custom modules)
6
S1:Strings
S2: File I/O
S3: 1D Mini Project 4 Demo

  • Open text file for reading and writing
  • Use file object as iterator in a for-loop
  • Use readline(), readlines(), and read() to read string from file object
  • Process string using split() and strip()
  • Obtain new string using slices
  • Search substring in a string
  • Compare string
  • Use string formatting
  • (* Use try and catch to handle exception when opening file)
7
Recess


8
S1: Objects and Classes
S2: Simple Inheritance
S3: More on Object Oriented

  • Create user-defined type using Class with attributes
  • Draw object diagram of an object
  • Explain has-a relationship
  • Discuss object aliasing and copying
  • Create Class with methods
  • Call object's methods
  • Explain what is self in the first arguments of a class methods
  • Initialise object using init method
  • Construct str method for a class
  • Use default arguments in methods
  • Create children class with inheritance from object class
  • Explain is-a relationship
  • Create property from getter and setter
9
S1: Introduction to State Machines
S2: Primitive State Machines and SM class
S3: 1D Mini Project 5

  • Draw finite state diagrams and timestep tables
  • Create subclass for state machine using sm class
  • Implement state machine getNextValues given a state diagram or timestep tables
  • Analyse Cascade combination of two state machines
10
S1: Proportional Controller
S2: PD Controller
S3: 1D Mini Project 6

  • Draw a feedback system with controller and a plant
  • Implement proportional controller
  • Implement derivative controller
11
2D Week


12
S1: GUI widgets
S2: GUI callbacks and binding
S3: Object oriented design

  • Import GUI library and create a new GUI application
  • Explain concept of main loop in GUI application
  • Explain and implement callback for event triggered actions
  • Create basic UI widgets such as buttons, labels, and text inputs
  • Arrange widgets in a frame
  • Create callables, and bindings
13
1D Project + Revision


14
Exam