For -G7 programing language Teacher / Shamsa Hassan Alhassouni
Decrypt Good Answer.. Well Done.. Teacher If the student answer the question correctly.. She will get a gift from her teacher
What we will Learn today? Understand IF statements Understand the syntax for using if statements in Python Understand other comparison operations in Python Work on flow charts Practical tasks
IF Statement Using If statements gives two or more possible choices that a program can follow
Think .. & give us another example ?? How many cases do I have in the traffic light case ? Think .. & give us another example ??
In your group draw the flowchart as requested Think – Work in group & Share In your group draw the flowchart as requested
Discover more through your practical activity NO Task Completed Not Completed 1 Open the python edu 2 Select ‘the existing project named (grade7-1) 3 Click file > new > python file 4 Give the python file a name. (L6 - Name) 5 Type the following: 6 Run your program and type maryam what you will get as an output.. 7 Type another name.. What will be the output
IF statement Syntax in Python We use == operator to check the if statement in python Think.. Conclude.. What is the difference between the following sentences : Num1 = 5 Num1 == 5 = used to set a value == used for comparison between two variables
Comparison Operations in Python
Answer the following questions Quick Quiz Answer the following questions When we will compare between two variables which operator we are going to use : == = != 2. The operator used to define greater than or equal in python is : > <= >= 3. The syntax for writing if statements in python is If name == ‘alia’ : Print (“hello”) If name == “alia” : If name == “alia” Print (“hello” 4. The operator used to define not equal in python is: /=
Super Student Task.. Create a program to ask the user about his car speed If speed is more than 80 then the following message should appear “slow down.. Too fast”
If you are done with your class activity.. Closing.. If you are done with your class activity.. print (“I am an Excellent Student” )
How easy did find the today’s lesson in python?