Class003_ Conditionalss
Class003_ Conditionalss
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 Variables and Ask questions,
(5 Mins) Data types. and prompt
● Meaning of variables answers.
● Rules of naming variable
● Data types: int, float, String
● Mathematical operations on int and float
Have you heard something like this from your If the student
parents or teachers? suggests any
example go with
Here, the condition is “completing the it and explain
assignment” what is the
condition and the
And if the condition is fulfilled or in other words action to be taken
is “True” if the condition is
true, in their own
Then the action of playing video game is example.
allowed or “executed”
2
Let’s see what happens if we put a F
alse
condition after if
3
Similarly, if we write b=8<1, then the value of
b is False, as the condition is false.
So, the first step is to get a number from the Explain the
user. input function helps us in doing so, but question and
one issue with input function is that it takes guide the student
input in String. to fill in the
blanks.
So to get a number in variable n um, we need to
convert S
tring into i nt. This change of data
type can be done by the function int
4
Now, we have a valid number in variable num.
Can you tell me when a number is even??
Thus, n
um%2==0 will be true if num is divisible
by 2 and false if num is not divisible by 2.
5
Imagine a situation, which can have more than Click on grading
just one condition, like a grading system. system.png to
open the image
6
● not
Heads up for the In the next class we will learn about some data
next class structures of python.
7
Resources: