4 Structured Programming with Python

DOI: 10.1201/9781003256861-4

Chapter Objectives

  • Understand the need for modifications to the sequential structure of Python programs.
  • Learn about selection structures and be able to implement the various if statement types to accomplish the required decisions.
  • Know how to use the for loop structure to implement count-controlled iteration.
  • Be able to program the while loop structure to accomplish pre-test, mid-test, and post-test loops, and combinations of those.
  • Create user-defined functions to “package” calculations.
  • Know how to break down programs into manageable modules, often with user-defined functions.
  • Understand the concept of variable scope as it relates to subprograms.
  • Learn how to store functions ...

Get Introduction to Engineering and Scientific Computing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.