Richard's Python 2020 Page

Richard Ricardo's example page of Python programming language.

0. Download and Install Python

Objective Description
Download & Install

Go to

Download the latest version for Windows

Create folder "python" in in c: drive, c:\python\

Double-click on the downloaded .exe file to install python for windows

Choose Customize install > Next > Change "Customize install location" to c:\python\

Note: Python is case sensitive.

Write the first program using IDLE

- do this one, easiest

Search for IDLE, OR Windows Icon > Python > IDLE
Pin to taskbar

Open IDLE, you will see "Python --- Shell"

print ("hello")

Note: IDLE is Python’s Integrated Development and Learning Environment.

To save file...

Create folder c:\temp\python

Show File Extensions in Windows - video 00_002

In IDLE > File > New File

File > Save As...



print ("hello world")

File > Save OR Ctrl-S

Run > Module or F5

Write the first program using Interactive Shell

Search for Python, OR Windows Icon > Python > Python


print ("hello")
Write the first program using notepad++

Do not try this if you have not programmed before

Install notepad++ (if you have not done so) - video 00_001

Show File Extensions in Windows - video 00_002

File Explorer > go to c:\temp\python\

Create new text document, name it cmd.bat, put in the following...


Double click on cmd.bat

Type the following (same to a text file, commands.txt, for future use)

set path=%path%;C:\python

Type this to run file

Others / Extra Dr. Coleman's notes 1 for Python Coding Camp


1. Variable

Objective Description
values, comments, variables, strings, type casting (eg001.txt)

right-click on file > Edit with IDLE

user input (eg002.txt)
string formatting, control string (eg003.txt)
Others / Extra - Turtle graphics Dr. Coleman's notes 2 for Python Coding Camp (
Others / Extra Dr. Coleman's notes 3 for Python Coding Camp


2. Arithmetic Operation

Objective Description
expressions, arithmetic (eg004.txt)
mixed type expressions (eg005.txt)
simple program example (eg006.txt)

Fahrenheit to Celsius, Celsius to Fahrenheit


3. Conditional Statement

Objective Description
boolean expressions, if .. else .. statements (eg007.txt)

and, or, not
pass statement
nested if (eg008.txt)


4. Iteration

Objective Description
while loop
Yes or No, uppercase (eg009.txt)

while loop
enter numbers (eg010.txt)
for loop (eg011.txt)
nested loops (eg012.txt)
GAME - guess my number 1 to 10 (game001.txt)


5. Functions

Objective Description
using function (eg013.txt)

using math, time functions etc. (eg014.txt)
writing functions (eg015.txt)
writing function turtle graphics (eg016.txt)
Others / Extra - Turtle graphics

Dr. Coleman's (dice.txt)
- generates a pair of randomly chosen dice
- introduce functions
- random library and if..else

Dr. Coleman's (maze.txt)
- draws a maze
- lets the user navigate through it using the arraw keys
- does not prevent walking through walls
- if..else, for loops, functions, hexadecimal numbers, bitwise operators




20. Others

Objective Description
Others / Extra - Turtle graphics

Dr. Coleman's (pong.txt)
- classes and objects, functions, if..else, while, boolean, keyboard events

Other / Extra - matplotlib Dr. Church's Game of Life