Example: Code sequencingΒΆ

Bad: In the code below the function ball_height() first appears before it is defined. This code is confusing to read since when one first sees ball_height() it is not clear what it is and where it is coming from.

Also bad: The code below will work if one executes the bottom code cell before executing the top one, but anyone reading the report will do it in the opposite order, from top to bottom, and this will result in an execution error:

Good: Code is entered sequentially and it is split into separate cells to better explain its purpose and structure.