Sample Page
Welcome, [[username : Student]]! This is the exercise sheet for [[institutionName : your module]].
View as: NUS · Sample Institution · Reset
| Exercise | Topic | Status |
|---|---|---|
| Exercise 1 | Setting Up Your Environment | |
| Exercise 2 | Writing Your First Program | |
| Exercise 3 | Advanced Problem Solving | |
| Exercise 4 | Peer Review & Submission |
Switch adaptation using the links above to see the labels change. NUS makes exercises 1, 2, and 4 compulsory; Sample Institution makes all four compulsory.
Configure your development environment for [[institutionName : this module]].
Linux Setup
sudo apt-get update && sudo apt-get install -y build-essential git python3
python3 --version
Windows Setup
winget install Python.Python.3 Git.Git
python --version
macOS Setup
brew install python3 git
python3 --version
Create a file named hello.py and write a personalised greeting:
# [[institutionName : Module]] — Exercise 2
name = "[[username : Student]]"
print(f"Hello, {name}! Welcome to [[institutionName : the module]].")
Run it with:
python3 hello.py
Submit hello.py to the [[institutionName : institution]] portal once you're done.
Solve the following problem and submit your solution.
Problem: Given a list of integers, return all pairs that sum to a target value.
def find_pairs(nums: list[int], target: int) -> list[tuple[int, int]]:
# Your solution here
pass
[[institutionName : Institution]] grading: Submissions are graded automatically. Ensure your function signature matches exactly.
Review a classmate's submission for Exercise 3 and provide structured feedback.
git clone https://github.com/[[username : classmate]]/exercise3.git
The sections below are controlled by the active adaptation — they are site-managed and cannot be toggled by individual users.
Submit your work via LumiNUS before the deadline.
Submit via the Sample Portal using your student ID.
This page is personalised for [[institutionName : all students]]. Logged in as: [[username : Guest]]