ENET 202 · SYLLABUS
Functions & Collections
Organize reusable logic and process ordered lists of data.
Learning outcomes
- Declare reusable functions
- Pass explicit parameters
- Process lists using zero-based indexes
Module schedule
MODULE 1 · Study → Live lab → Practice
Define a function
fn declares reusable logic with named parameters. return produces its result and is valid only inside a function. Call the function by name after its declaration.
Assignment: Create a function that labels an ENET project.
MODULE 2 · Study → Live lab → Practice
More than one input
Functions can take several parameters separated by commas. Calls must supply exactly the declared number of arguments. Prefer clear names describing each input.
Assignment: Write a function that adds two project estimates.
MODULE 3 · Study → Live lab → Practice
Lists & indexes
Square brackets create a list. Indexes start at zero. len returns its item count. Only integer indexes inside the list’s bounds are accepted; list mutation and object properties are not supported.
Assignment: Replace the list with three application ideas.
MODULE 4 · Study → Live lab → Practice
Process a list
Combine len, repeat and a zero-based counter to visit every list item. This pattern replaces for/while loops in the current prototype.
Assignment: Print numbered entries by adding str(index + 1).
Final project: A reusable project-summary toolkit
Create a reusable label function and apply it to a list of two projects.
- Use a function with name and category parameters
- Uppercase the category
- Walk both list items with repeat and len
Review correctness against the sample output, readability, comments and the documented limits of your prototype. Extend and test additional inputs after completing the sample.