Skip to main content Start main content

Workshop: Introduction to Python programming for non-programmer I (Evening)

Workshop/ Training/ Webinar

  • Date

    07 - 14 Sep 2022

  • Organiser

    ITS

  • Time

    18:00 - 20:30

  • Venue

    Online (MS Teams)  

Summary

Introduction to Python programming for non-programmer I (2 lessons)

Date: 7 Sep and 14 Sep

Time: 18:00 - 20:30

Target Audience: All Students

Medium of Instruction: English

Pre-requisite: Nil


What you will learn

- Understand the history and advantages of Python language
- Use Python Shell to write and execute Python codes
- Open and edit Python codes in IDLE editor
- Customize the IDLE working environment
- Work with Python variable such as assigning values and casting data type
- Know the common data types in Python
- Use operators to get numerical or logical values from variables
- Define a Python function to run repetitive process
- Define a function with different formats of input arguemnts
- Control the logical flow of a Python program using if, else and elif
- Loop over a segment of codes with a control variable using for and while


 

Course outline

Lesson 1

  1. Introduction
    1. History of programming and Python
    2. Reasons of using Python
  2. Getting start with Python
    1. Using Python in interpreter/shell
      1. Execution and exiting
    2. Running Python script in the command line
    3. IDLE (Integrated Development and Learning Environment)
      1. Using IDLE shell
      2. Working with Python file
      3. Debugging
      4. Customizing fonts/tabs, highlights and keys
  3. Variables
    1. Creating variables
    2. Casting
  4. Data Types and Operators
    1. Text, numeric, sequence, mapping, set, Boolean
    2. Operations on values and variables
      1. Arithmetic operators
      2. Assignment operators
      3. Comparison operators
      4. Logical operators
      5. Identity operators

 

Lesson 2

  1. Function
    1. Defining and calling a function
    2. Arguments
      1. Default argument
      2. Keyword argument
      3. Variable-length argument: non-keyword vs keyword
    3. Docstring
      1. Writing and retrieving docstring
  2. Control flow
    1. If-else
      1. A simple if-else statement
      2. Short-hand form of If and if-else
      3. Elif
      4. Combining conditional statements
    2. Loops
      1. While loop
        1. Break and continue
        2. Else
      2. For loop
        1. Iterating over different iterators
        2. Break and continue
        3. Nested loops

Your browser is not the latest version. If you continue to browse our website, Some pages may not function properly.

You are recommended to upgrade to a newer version or switch to a different browser. A list of the web browsers that we support can be found here