Skip to Main Content
Python Programming: A modular approach
book

Python Programming: A modular approach

by Kumar Naveen, Taneja Sheetal
January 2017
Intermediate to advanced content levelIntermediate to advanced
606 pages
14h 1m
English
Pearson Education India
Content preview from Python Programming: A modular approach

CHAPTER 3

CONTROL STRUCTURES

CHAPTER OUTLINE

3.1 if Conditional Statement

3.2 Iteration (for and while Statements)

The functions that we have developed so far had the property that each instruction in a function was executed exactly once. Further, the instructions in these functions were executed in the order in which they appeared in the functions. Such functions are called straight line functions. However, real life problems would usually require non-sequential and repetitive execution of instructions. Python provides various control structures for this purpose. In this chapter, we will study the following control structures with suitable examples: if, for, and while.

 

control structures are used for non-sequential and repetitive execution ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modular Programming with Python

Modular Programming with Python

Erik Westra
Python Programming Blueprints

Python Programming Blueprints

Daniel Furtado, Marcus Pennington

Publisher Resources

ISBN: 9789352866038