0% found this document useful (0 votes)
18 views2 pages

CornellNotesTemplate Week5

The document outlines the concepts of decomposition and functions in programming, emphasizing the importance of breaking down complex problems into manageable parts for easier debugging and maintenance. It discusses the types of functions, including built-in and user-defined functions, and the significance of function arguments and return values. Additionally, it highlights the role of modularity in organizing related functions and the principles of computational thinking for effective problem-solving.

Uploaded by

Henrique de Lima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

CornellNotesTemplate Week5

The document outlines the concepts of decomposition and functions in programming, emphasizing the importance of breaking down complex problems into manageable parts for easier debugging and maintenance. It discusses the types of functions, including built-in and user-defined functions, and the significance of function arguments and return values. Additionally, it highlights the role of modularity in organizing related functions and the principles of computational thinking for effective problem-solving.

Uploaded by

Henrique de Lima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Week: __5__________________ Name: _Henrique de Lima Silva___

Assignment: Decomposition and Functions Class: __IT 125-02P _____


Page 1 of 2 Date: __05/24/2024____ __

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):

Functions must be called to perform their actions.


Using (Calling) Functions They can be part of an algorithmic sequence or based on a
condition.

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.

Function return values:


Functions can return values using `return`.

Modules: Related functions grouped together.


Modularity Libraries: Collections of modules.
Built-in modules include os, random, math, etc.
Abstracts away complexity, focusing on function input and output.

Decomposition in Computational thinking involves finding clear, step-by-step


Computational Thinking: solutions to complex problems.
Solving Problems More Key components: breaking down problems, recognizing patterns,
Effectively eliminating unnecessary details.

You might also like