Preliminary Software Engineering
Unit 1 - Programming Fundamentals
Unit 1 - Programming Fundamentals
  • 1 - Programming Fundamentals
    • Programming Fundamentals Content
  • 2 - Python
    • Expected Python Knowledge
    • GitHub
    • Learning Python
    • Data Structures and File Management
      • Data Structures
        • Lists
        • Arrays
          • Single and Multi-Dimensional Arrays
        • Lists vs Arrays
          • Activities
        • Tuples
        • Sets
        • Dictionaries
          • Activities
      • File Handling
        • Loops, Lists, Dictionaries
        • Activities
  • 3 - Theory Content
    • Theory Content Explained
      • NESA Directional Verbs
      • Responding to Directional Verbs
  • 4 - Software Development and Management
    • Approaches to Software Development
      • Waterfall Model
      • Agile Model
      • Summary: Waterfall vs Agile
      • Activities
    • Software Development Steps
      • Sample Exam Question
      • Requirements Definition
        • Understanding the Need
        • Key Questions to Ask
        • Examples
        • Activities
        • Sample Exam Question
      • Determining Specifications
        • Functional Specifications
        • Non-Functional Specifications
        • Activities
      • Design
        • Top-Down Design Approach
        • Bottom-Up Design Approach
      • Development
        • Optimising Code
      • Integration
        • Example: Payment Program
        • Activity
        • Application Programming Interface (API)
          • Example: OpenWeather API
          • Example: WeatherAPI
          • Activity: Prepare Spells
      • Testing and Debugging
        • Test Data
          • Activities
        • Testing the System
          • Activities
        • Debugging
          • Types of Errors
            • Activities
          • Python Debugger
            • Activities
          • VS Code Debugger
            • Activities
      • Installation
        • Activities
        • Sample Exam Question
      • Maintenance
  • Charts and Algorithms
    • Example: IPO Charts and Pseudocode
      • Activities
    • Algorithms, Flowcharts, Pseudocode
      • Pseudocode Activities
      • Flowchart Activities
      • Sample Exam Questions
    • Structure Charts
      • Activities
      • Sample Exam Questions
    • Data Flow Diagrams
      • Activities
    • Data Dictionaries
      • Activities
    • Decision Trees
      • Activities
      • Sample Exam Questions
    • Gantt Chart
    • Class Diagrams
      • Sample Exam Question
    • Storyboards
      • Sample Exam Question
  • Testing and Debugging
    • Test Data
      • Activities
    • Testing the System
      • Activities
    • Debugging
      • Types of Errors
        • Activities
      • Python Debugger
        • Activities
      • VS Code Debugger
        • Activities
  • Computational Thinking
    • Decomposition
    • Abstraction
    • Activities
  • Version Control
    • Git
    • GitHub
    • Activities
  • Number Systems
    • Binary Systems
    • Hexadecimal Numbers
    • Using Two's Complement
    • Activities
  • 5 - Assessment Task 1
    • Data Science Project
      • Before we Start
        • Setting up GitHub Repository
        • Setting Up Markdown Documentation
      • Examples of API Usage
        • Starter Code: NASA Scenario
        • Starter Code: Spell Book
        • Starter: Pokédex Explorer
        • Starter Code: Weather App
        • Example: OpenWeather API
        • Example: WeatherAPI
        • Example: Prepare Spells
    • Task Guide
      • Requirements Definition
      • Determining Specifications
        • Use Cases
      • Design
        • Gantt Chart
        • Structure Chart
        • Algorithms
        • Data Dictionary
      • Development
        • Comments vs DocStrings
        • UI - main.py
        • Create Python Module
          • Example: NASA Module
          • Example: WeatherFetch Module
          • Example: SpellBook Module
      • Integration
        • Example: Pokedex
      • Testing and Debugging
        • Commit Changes
      • Installation
      • Maintenance
    • Submitting Your Task
Powered by GitBook
On this page
  • Programming Fundamentals
  • Control Structures
  • Variables
  • Simple and Structured Data Types
  • Functions
  • Modules and Libraries
  • File Handling
  • Object-Oriented Programming
  • Classes, Objects, Attributes and Methods
  1. 2 - Python

Expected Python Knowledge

From the course specifications, you are expected to be understand the following skills in Python by the end of your HSC. They have been broken down further for clarity, so make sure you have a read of the following and use your time wisely at the beginning of the course to get your head around some of this!

Programming Fundamentals

Control Structures

  • Conditional Statements: Understand how to use if, elif, and else statements to control the flow of a program.

  • Loops: Master the use of for loops and while loops for repeating tasks.

  • Loop Control Statements: Learn about break, continue, and pass to manage the behavior of loops.

  • Comprehensions: Use list comprehensions and dictionary comprehensions for creating new sequences.

  • Error Handling: Implement try and except to manage exceptions.

Variables

  • Global Variables: Variables defined outside of a function and accessible from anywhere in the code. Understand their scope and usage.

  • Local Variables: Variables defined within a function or block, accessible only within that function. Comprehend their scope and limitations.

  • The global Keyword: Learn how to declare a variable as global within a function to modify it outside of the function's local scope.

Simple and Structured Data Types

Simple Data Types

  • Integers (int) – Whole numbers (e.g., 10, -5, 42)

  • Floating-point numbers (float) – Decimal numbers (e.g., 3.14, -0.5, 2.0)

  • Booleans (bool) – True or False

  • Strings (str) – Text data enclosed in quotes (e.g., "Hello", 'Python')

Structured Data Types

  • Lists (list) – Ordered, mutable collection (e.g., [1, 2, 3], ["apple", "banana"])

  • Tuples (tuple) – Ordered, immutable collection (e.g., (1, 2, 3), ("red", "blue"))

  • Dictionaries (dict) – Key-value pairs (e.g., {"name": "Alice", "age": 25})

  • Sets (set) – Unordered, unique elements (e.g., {1, 2, 3})

Functions

  • Defining a function – Use def keyword (def function_name():).

  • Calling a function – Use the function name followed by ().

  • Parameters – Pass values into a function (def greet(name):).

  • Return statement – Send a value back using return.

  • Default parameters – Provide a default value (def greet(name="Guest")).

Modules and Libraries

  • Modules – Files containing Python code (.py) that can be imported.

  • Importing Modules – Use import module_name.

  • Using from Import – Import specific functions or classes (from module import function).

  • Built-in Modules – Pre-installed modules like math, random, datetime.

  • Third-Party Libraries – Installed using pip (e.g., numpy, pandas).

  • Creating a Module – Write functions in a .py file and import them.

  • Packages – Collections of modules organised in directories with __init__.py.

File Handling

  • Opening a File – Use open("filename", "mode").

  • Modes – 'r' (read), 'w' (write), 'a' (append), 'x' (create).

  • Reading a File – Use .read(), .readline(), or .readlines().

  • Writing to a File – Use .write("text").

  • Appending to a File – Use mode 'a' to add content without deleting existing data.

  • Closing a File – Always use .close() or with open() as f: for automatic closing.

  • Handling Exceptions – Use try-except to catch file errors.


Object-Oriented Programming

Classes, Objects, Attributes and Methods

  • Classes – Blueprints for creating objects (class ClassName:).

  • Objects – Instances of a class (obj = ClassName()).

  • Attributes – Variables stored in an object (self.attribute = value).

  • Methods – Functions inside a class (def method(self):).

  • __init__ Method – Constructor for initialising attributes.

  • self Keyword – Refers to the instance of the class.

  • Creating & Using Objects – Instantiate and access attributes/methods.

  • Inheritance – A class can inherit attributes and methods from another class (class Child(Parent):).

  • Polymorphism – Different classes can have methods with the same name but different behavior.

  • Encapsulation – Restrict direct access to data using private/protected attributes (_protected, __private).

PreviousProgramming Fundamentals ContentNextGitHub