Class005_ Loops
Class005_ Loops
Module Basic
Resources Teacher:
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To note any
development from session)
Student Resources
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To keep note of
important parts in the session)
Duration 50 Mins
1
Step Say Perform
Interaction In the last class, we learnt about some data Revise the
(5 Mins) structures in Python: concepts learned
Lists, Tuples, Dictionary, Sets, String in the previous
We also used a few functions on these data class.
structures.
2
Similarly, n
-=1 is called decrement operator and
it will decrease the value of n by 1.
Both these increment and decrement operators
make up the update statements.
For example, factors of the number 6 are 1,2,3 Ask for factors of
and 6 itself. another number
from the student.
3
Remind them the
input function
and the need of
int function
for i in ds:
print(i)
4
10,11,12,13,14
So the number less than the ending value is
returned, not the ending value itself.
Now, for the second activity we need to take Help the student
number as input from the user to solve both
activities.
Revision So today we learned about for loop, while loop Revise all the
and range function. concept learned
in class briefly
Q. Can you tell me what are the three parts Ask basic
necessary in a while loop? questions and
A. Initial value, Conditional statement and prompt the
Update statement student to give
5
Q. What will happen if there is no update answers
statement in loop and the condition is true?
A. The loop will run infinitely.
Heads up for the In the next class we will be using all the concepts
next class we have learned so far and also learn about
Functions.
Resources:
Student Activity 3