# Functions and decomposition

> A reusable named block that can accept inputs and return a result.

Course: [Python programming foundations](https://studybrix.com/en/courses/python-programming/index.md)
Level: university
Prerequisites: Basic computer literacy.

## Notes

### Function

A reusable named block that can accept inputs and return a result.

### Parameter

A local name representing an input in a function definition.

### Return value

The result a function sends back to its caller.

### Decomposition

Breaking a larger problem into smaller, testable parts.

## Practice questions

### 1. Which term best matches this description: A reusable named block that can accept inputs and return a result.

A. Decomposition
B. Return value
C. Parameter
D. Function

Answer: Function

Explanation: Function is the matching concept in this lesson.

### 2. Which term best matches this description: A local name representing an input in a function definition.

A. Function
B. Return value
C. Parameter
D. Decomposition

Answer: Parameter

Explanation: Parameter is the matching concept in this lesson.

### 3. Which concept would you apply first in a situation where the result a function sends back to its caller.

A. Decomposition
B. Function
C. Return value
D. Parameter

Answer: Return value

Explanation: The scenario directly calls for Return value.

### 4. Name the concept described as: Breaking a larger problem into smaller, testable parts.

Answer: Decomposition

Explanation: The intended concept is Decomposition.

### 5. Which statement about Function is most accurate?

A. The result a function sends back to its caller.
B. Breaking a larger problem into smaller, testable parts.
C. A reusable named block that can accept inputs and return a result.
D. A local name representing an input in a function definition.

Answer: A reusable named block that can accept inputs and return a result.

Explanation: The definition in the lesson notes gives the required condition.

### 6. Explain one important difference between Function and Parameter.

Sample answer / marking guidance: Function: A reusable named block that can accept inputs and return a result. Parameter: A local name representing an input in a function definition.

Explanation: Credit a clear distinction using both definitions and an appropriate example if supplied.

### 7. Give a short example showing how Return value would be used in practice.

Sample answer / marking guidance: A valid example should demonstrate this idea: The result a function sends back to its caller.

Explanation: Credit a relevant scenario that applies the concept rather than merely naming it.

### 8. Summarize why Decomposition matters in the lesson “Functions and decomposition”.

Sample answer / marking guidance: Decomposition matters because Breaking a larger problem into smaller, testable parts.

Explanation: Credit the core purpose, scope and any important limitation from the notes.

## Further reading

- https://docs.python.org/3/tutorial/

Original AI-assisted educational draft; not independently teacher-reviewed. References support further study, not copied exercises, affiliation or curriculum accreditation.
