CornellNotesTemplate Week5
CornellNotesTemplate Week5
Instructions: You must read the material and create an outline of the topics in your OWN words. Do not copy
the text from the tutorials into your notes. Make sure your outline contains notes for each subsection of the
reading assignment. Thoroughly cover each topic to show you have a firm understanding of the programming
concept or construct.
Ques NOTES:
Decomposition Breaking down a complex problem into smaller, manageable
parts.
Week: __5__________________
Smaller chunks make it easier to findName:
and fix_Henrique
bugs. de Lima Silva___
Assignment: DecompositionSimplifies
and Functions Class: __IT 125-02P _____
code maintenance and updates.
Page 2 of 2 Date: __05/24/2024____ __
Designed to solve common problems (e.g. logging in, displaying
Functions menus).
Specialized functions for unique tasks.
Reusing functions speeds up application development.
Functions follow the principles of abstraction.
They are named, require input and produce return values.
Assembled into a complex system based on their functionality.
Types of functions:
Built-in functions:
Provided by Python's standard library.
Programmers learn how to use them from the documentation.
User-defined Functions:
Created by the programmer.
Share the same anatomy as built-in functions.
Syntax: def function_name(parameters):
Function arguments:
Positional arguments:
Order matters.
Example: `calcPay(user_wage, user_time)` passes `user_wage`
to `wage` and `user_time` to `hours`.
Keyword arguments:
Order does not matter.
Example: calcPay(hours=25, wage=16) explicitly assigns values to
the parameters.