Skip to main content Start main content

Workshop: Introduction to Python programming for non-programmer I

Workshop/ Training/ Webinar

event_20220608_python1
  • Date

    21 - 28 Jun 2022

  • Organiser

    ITS

  • Time

    14:30 - 17:00

  • Venue

    Online (MS Teams)  

Summary

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

Date: 21 Jun and 28 Jun

Time: 14:30 - 17:00

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 arguments
  • 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

(1) Lesson 1

1. Introduction

a. History of programming and Python

b. Reasons of using Python

2. Getting start with Python

a. Using Python in interpreter/shell

i. Execution and exiting

b. Running Python script in the command line

c. IDLE (Integrated Development and Learning Environment)

i. Using IDLE shell

ii. Working with Python file

iii. Debugging

iv. Customizing fonts/tabs, highlights and keys

3. Variables

a. Creating variables

b. Casting

4. Data Types and Operators

a. Text, numeric, sequence, mapping, set, Boolean

b. Operations on values and variables

i. Arithmetic operators

ii. Assignment operators

iii. Comparison operators

iv. Logical operators

v. Identity operators

(2) Lesson 2

1. Function

a. Defining and calling a function

b. Arguments

i. Default argument

ii. Keyword argument

iii. Variable-length argument: non-keyword vs keyword

c. Docstring

i. Writing and retrieving docstring

2. Control flow

a. If-else

i. A simple if-else statement

ii. Short-hand form of If and if-else

iii. Elif

iv. Combining conditional statements

b. Loops

i. While loop

1. Break and continue

2. Else

ii. 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