Basics of Python Programming: A Quick Guide for Beginners

Control Flow

Author(s): Krishna Kumar Mohbey* and Malika Acharya * .

Pp: 43-60 (18)

DOI: 10.2174/9789815179637123010005

* (Excluding Mailing and Handling)

Abstract

It's now the time for the readers to acquaint themselves with the control flow in the programming. So far the users have seen the linear path of execution, where the execution commences from the top and moves sequentially to the bottom. Further, our world is filled with tasks required to run in loops, for example in banking applications, unless the user enters the correct password the system prompts the dialogue “Please enter the correct password”. In this chapter, we introduce the concept of control flow through which the users can decide the execution path for the program and the looping constructs to iterate through the tasks. Our key takeaways from this chapter are listed below: 1. Understanding the decision control statements. 2. Programming with if-else ladder and its variants. 3. A hand on for, and while loop statements. 4. Understanding the control flow alterations the jump statements like break, continue and pass.

© 2024 Bentham Science Publishers | Privacy Policy