Data Flow
Coding: Introduction to Python v3, topic 3.2.1
Passing Parameters
Passing parameters allows us to send data into a subroutine.

Passing parameters
- Passing parameters is the process of passing a piece of data into a subroutine.
- The data is then assigned into a local variable (parameter) inside of the subroutine.
- We can then use this data inside the subroutine.

Parameters vs global variables
- We could also pass data by putting it inside of a global variable.
- This is considered bad practice, since it can be accessed by any subroutine. Passing parameters is a much more secure, and maintainable approach.
Returning Multiple Values
Sometimes, a situation might arise where we wish to return multiple pieces of data from the same subroutine.

Returning values
- Functions are subroutines that return a value.
- In Python, a function can return multiple values.
- These values are automatically grouped together (as a tuple).

Returning a list
- Another solution is to return a list of values.
- We can create a list and append each value we want to return.
- This list can then be returned, containing all of the values.

Restructuring subroutines
- In some scenarios, it may be better to restructure subroutines so they return a single value.
- Returning multiple values is acceptable when the values are related.
- If a function returns many unrelated values, it may be a sign that the function should be split into smaller functions.
Test yourself on Data Flow
When data is passed as a parameter, it is assigned to what type of variable inside the subroutine?
Which is the best method to use in Python when multiple related values need to be returned from a function?