0% found this document useful (0 votes)
3 views21 pages

2 PythonRevisionTour1B

The document provides a detailed overview of looping statements in Python, focusing on for loops and while loops. It covers the syntax, practical implementations, and the use of the else clause with for loops. Additionally, it includes a checklist summarizing the key topics discussed in the revision tour.

Uploaded by

lagaf55350
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views21 pages

2 PythonRevisionTour1B

The document provides a detailed overview of looping statements in Python, focusing on for loops and while loops. It covers the syntax, practical implementations, and the use of the else clause with for loops. Additionally, it includes a checklist summarizing the key topics discussed in the revision tour.

Uploaded by

lagaf55350
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Revision Tour – 1

Looping Statement TITLE 01


Here we will understand in detail about
looping statements

T I inT Python
L E 0(for
2 and while)
Types of loops Here we will understand two types
of loops

For loop TITLE 03


Here we will understand the
syntax of for loop

Various Questions
TITLE 04
Here we will understand practical
implementation of for loop
based on for loop

TITLE 05
Series based question Here we will understand various series based
question using for loop
based on for loop

TITLE 06
Here we will understand for loop’s else
Loop else Statement statement and its use.
If we want to execute a
statement repeatedly
based on a certain
condition, the concept is
known as Looping or
Iteration

Chapter 1 3
1. For loop

2. While Loop

Chapter 1 4
for loops, in general, are used for sequential traversal. It falls
under the category of definite iteration. Definite iterations
means the number of repetitions is specified explicitly in
advance.

The general form of for loop:

for <variable> in <sequence>:


statements to repeat

Chapter 1 5
for x in [10,20,30,40]:
print(x, end=“ “)
Output:
10 20 30 40

Chapter 1 6
Three ways to define a range:
range(stop) #elements from 0 to stop–1 incremented by 1

range(start, stop) #elements from start to stop -1 incremented


by 1

range(start, stop, step) #elements from start to stop -1


incremented by step

Chapter 1 7
Chapter 1 8
When gap between When gap between
values is constant values varies
or fixed

Chapter 1 9
Python loops have an optional else clause.
Complete Syntax of for loop with else clause:
for <variable> in sequence:
statement1
statement2
:
else:
statements
Chapter 1 10
Chapter 1 11
Chapter 1 12
Chapter 1 13
Chapter 1 14
CHECK LIST
Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED


FOR LOOP

LOOP ELSE STATEMENT


CHECK LIST
Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED


FOR LOOP

LOOP ELSE STATEMENT


Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED


FOR LOOP

LOOP ELSE STATEMENT


CHECK LIST
Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED
FOR LOOP

LOOP ELSE STATEMENT


CHECK LIST
Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED
FOR LOOP 
LOOP ELSE STATEMENT
CHECK LIST
Python Revision Tour 1

LOOPING STATEMENTS

TYPES OF LOOPS

FOR LOOP

VARIOUS QUESTIONS ON FOR LOOP

SERIES BASED QUESTIONS BASED
FOR LOOP 
LOOP ELSE STATEMENT

You might also like