COMP9001 — Chapter 1 Supplement
Foundations & Quick Checks
A compact revision page for the key definitions, workflow, commands, and interpreter concepts introduced in Lecture 1.
Program Definition
Definition
A program is a set of instructions for a computer to execute in sequence to perform a certain task.
Which part of the definition makes order explicitly important?
Sequence and Logic
Lecture use of examples
Joining class or following a recipe works only when the actions are ordered correctly. The course uses these examples to introduce algorithmic thinking before code syntax.
Why are everyday instruction lists useful in an intro programming lecture?
Source Code Translation
Item
Term
Meaning
Text file
Source code
Human-readable program text written in a programming language
Binary execution form
Machine code
The form the hardware can actually execute
Whole program first
Compiler
Translates the source code before running
Line by line
Interpreter
Translates while the program is running
What is the lecture’s main distinction between a compiler and an interpreter?
Tools and Commands
Command
Usage
Purpose
pwdwhere am I?
Show the current directory
lsview contents
List files and folders
mkdirmake directory
Create a folder
cdchange directory
Move to another location
touchcreate file
Make a new file like
hello.pymv / cpmove / copy
Manage files
First Program Workflow
Three steps
1. Create a .py file. 2. Write code into the file. 3. Run the file.
Which step comes immediately after creating the file?
Output and Interpreter
Built-in function
print() is introduced as a built-in function used for text output.
Python shell
Running python3 opens the interpreter, where code can be executed immediately and the results are shown right away.
Why is the interpreter useful for beginners?