Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Control_Structures_Python

The document explains control structures in Python, which dictate the flow of execution in a program, including sequential, selection, and iterative statements. It details the types of selection statements (if, if-else, if-elif-else) and iterative statements (for and while loops), along with examples. Additionally, it covers jump statements like break and continue, and concludes with a hands-on activity and discussion on real-world applications.

Uploaded by

ankishavgs
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Control_Structures_Python

The document explains control structures in Python, which dictate the flow of execution in a program, including sequential, selection, and iterative statements. It details the types of selection statements (if, if-else, if-elif-else) and iterative statements (for and while loops), along with examples. Additionally, it covers jump statements like break and continue, and concludes with a hands-on activity and discussion on real-world applications.

Uploaded by

ankishavgs
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Control Structures in Python

Understanding Sequential, Selection,


and Iterative Statements
Introduction to Control Structures
• • Control structures determine the flow of
execution in a program.
• • Types of Control Structures:
• 1. Sequential Statements
• 2. Selection Statements
• 3. Iterative Statements
Sequential Statements
• • Definition: Statements are executed one
after another in a sequential manner.
• • Syntax Example:
• statement1
• statement2
• statement3
Selection Statements (Conditional
Statements)
• • Used to make decisions in programs.
• • Types:
• 1. if statement
• 2. if-else statement
• 3. if-elif-else statement
• • Example Code:
• num = 10
• if num > 0:
• print('Positive number')
Iterative Statements (Loops)
• • Used for executing a block of code multiple
times.
• • Types:
• 1. For Loop
• 2. While Loop
• • Example Code:
• for i in range(5):
• print('Iteration:', i)
Jump Statements
• • Control the flow of loops and conditional
statements.
• • Types:
• 1. Break Statement - Exits the loop
immediately.
• 2. Continue Statement - Skips the current
iteration.
• • Example Code:
• for i in range(5):
Hands-on Activity
• • Solve the 'I Know' exercise on page 108.
• • Write small programs to test different
control structures.
Summary & Discussion
• • Recap of all control structures.
• • Discussion on real-world applications.
• • Q&A Session.

You might also like