Agenda of LO CS.1.11 W7-8
1- Warm up Revision 10 min
2- ppt teacher demonstrate about Python 15m
3- Video about Python 5min
4- Practical work Students divided in pairs and use
Anaconda : Spyder or on line Python platform to
create very simple program using python
-3.8.1 7
- Questions and answers as pretest about Python 5 m
8-Refelection 5 min
9- Home work 5 min
Python
Eng. & Educator Osama
Ghandour
LO CS.1.11 W7 :
Understand and interpret concept
the loop statements and give some
examples. • Students can design
programs involving loop
statements. • Gain knowledge and
understanding of function of the
loops inside the program. •
Students can compare between
Lesson plan
Python
Eng. & Educator Osama
Ghandour
Warm Up
Listen to this video
Offline
On line
Python
Eng. & Educator Osama
Ghandour
Warm up 5 min
1-Using logical operators and give
some examples.
2- using & Comparing between if
&switch statements and give some
examples.
3- Write the general syntax of the
conditional statements (if& switch).
Eng. & Educator Osama
Ghandour
Python
Warm up in python .
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
6
if
 If statement: Executes a group of
statements only if a certain condition is
true. Otherwise, the statements are
skipped.
 Syntax:
if condition:
statements
 Example:
gpa = 3.4
if gpa > 2.0:
print "Your application is accepted."
Eng. & Educator Osama
Ghandour
7
if/else
 if/else statement: Executes one block of statements if a certain
condition is True, and a second block of statements if it is False.
 Syntax:
if condition:
statements
else:
statements
 Example:
gpa = 1.4
if gpa > 2.0:
print "Welcome to Mars University!"
else:
print "Your application is denied."
 Multiple conditions can be chained with elif ("else if"):
if condition:
statements
elif condition:
statements
else:
statements Eng. & Educator Osama
Ghandour
8
while
 while loop: Executes a group of statements as long as a condition
is True.
 good for indefinite loops (repeat an unknown number of times)
 Syntax:
while condition:
statements
 Example:
number = 1
while number < 200:
print number,
number = number * 2
 Output:
1 2 4 8 16 32 64 128
Eng. & Educator Osama
Ghandour
9
Relational VS Logic
 Many logical expressions use relational operators:
 Logical expressions can be combined with logical operators:
 Exercise: Write code to display and count the factors of a number.
Operator Example Result
and 9 != 6 and 2 < 3 True
or 2 == 3 or -1 < 5 True
not not 7 > 0 False
Operator Meaning Example Result
== equals 1 + 1 == 2 True
!= does not equal 3.2 != 2.5 True
< less than 10 < 5 False
> greater than 10 > 5 True
<= less than or equal to 126 <= 100 False
>= greater than or equal to 5.0 >= 5.0 True
Eng. & Educator Osama Ghandour
functions
10
Eng. & Educator Osama
Ghandour
Further programming
• Lab exercises
– Let's go downstairs to the basement computer
labs!
• - learn prcticaly
• What next?
– Lists , Dictionaries , Algorithms etc.
Eng. & Educator Osama
Ghandour
http://ide.geeksforgeeks.org/
Eng. & Educator Osama Ghandour
Essential Questions
• Essential Questions:
1- What is the function
of the loop statement?
2- What is the general
syntax of the loop
statements? Eng. & Educator Osama
Ghandour
Essential Questions
• Essential Questions:
3- Write a code to repeat a
text "Egypt" 5 times.
4- Write a code to display
the odd, even numbers
from 0 to 10 and their sum.
Eng. & Educator Osama
Ghandour
Essential Questions
• Essential Questions:
5- Write a code to
display the integer
numbers between 1 to
100 divisible by 7
Eng. & Educator Osama
Ghandour
16
while
 while loop: Executes a group of statements as long as a condition
is True.
 good for indefinite loops (repeat an unknown number of times)
 Syntax:
while condition:
statements
 Example:
number = 1
while number < 200:
print number,
number = number * 2
 Output:
1 2 4 8 16 32 64 128
Eng. & Educator Osama
Ghandour
Iteration Loop structure
While
x=0
while (x<5):
print("Egypt" )
X=x+1
Eng. & Educator Osama
Ghandour
Types of loops in python
for loop using range()
function to write even and
odd numbers .
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
For loop
sume = 0
sumo = 0
for x in range (11):
if x%2==0:
print (x , "is even number")
sume=sume+x
else :
print (x , "is odd number")
sumo=sumo+x
print (sume , "summestion of even numbers")
print (sumo , "summestion of odd numbers")
Eng. & Educator Osama
Ghandour
• 0 is even number
• 1 is odd number
• 2 is even number
• 3 is odd number
• 4 is even number
• 5 is odd number
• 6 is even number
• 7 is odd number
• 8 is even number
• 9 is odd number
• 10 is even number
• 30 summestion of even numbers
• 25 summestion of odd numbers
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Types of loops in python
for loop using range()
function to write integer
numbers divided by 7 .
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
Evidence of Learning:
Create a project with a
programming language
“Python” using different types
of Loops.
Eng. & Educator Osama
Ghandour
Connection to math
Eng. & Educator Osama
Ghandour
Create, interpret and analyze quadratic functions that model
real-world situations. W1-4
Key Concepts:
o 1. Quadratic Function
o 2. First and second differences
o 3. Completing the square
o 4. Complex numbers
o 5. Parabola
o 6. Focus
o 7. Argand diagram
o 8. related roots
Mechanics
Eng. & Educator Osama Ghandour
Learning Outcome: Use position, displacement, average and instantaneous velocity,
average and instantaneous acceleration to describe 1-dimensional motion of an object.
W1-3
Key Concepts:
o 1. Position /Time graphs
o 2. velocity/Time graphs
o 3. Acceleration /Time graphs
o 4. Relative velocity.
o 5. Instantaneous velocity
o 6. Average velocity
o 7. Reference Frames
Mechanics
Eng. & Educator Osama
Ghandour
Week 04 - Week 08
Learning Outcome: Use kinematic equations to
understand and predict 1-dimensional motion of objects
under constant acceleration,including vertical (free-fall)
motion under gravity.
Key Concepts:
 1. Area under a curve
 2. Kinematic equations for 1-D motion with constant
acceleration
 3. Free-fall motion
Physics
• . Fluids w1-3
• 2. Pressure
• 3. Manometer
• 4. Pressure gauge
• 5. Units of pressure
• 6. Effect of atmospheric pressure on boiling
point of water
• 7. Change in atmospheric pressure with altitude
• 8. Pressure difference and force
• 9. Archimedes Principle
Eng. & Educator Osama
Ghandour
Check your email to Solve the
Online auto answered
quiz 15 min after
school the quiz will be
closed in 10:00pm
after
tomorrow
Eng. & Educator Osama
Ghandour
Python
Repetition (loops) in
Python.
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
Read /write to Arduino pins
Eng. & Educator Osama
Ghandour
Now you can plug the usb cable
Eng. & Educator Osama
Ghandour
Run Arduino UNO with PyFirmata
library
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Communicate with standard Firmata
as downloading it to Arduino
Eng. & Educator Osama
Ghandour
Now you can un plug
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Arduino Temperature control
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Summary
1-Types of Loops.
2- while loop.
3- for loop
4-Loop control statement (start, end
and step).
5- Control all loops by break &
continue statements.
6- Infinite loop
Eng. & Educator Osama
Ghandour
Python
Prepare for next week
According to student’s law
Gn=Wn % Ng
CS.1.07 - 1- Gain knowledge
and understanding the
meaning of computer
language? 2- Draw conclusions
about concepts
Eng. & Educator Osama
Ghandour
Python
Reflection
• Mention 2 things you learned today
• What is your goal to accomplish in
next week end in programming using
Loops in Python?
Eng. and Educator Osama
Ghandour
Python
Home work (s. proj.) 1
you studied in physics about
electric power and in your capstone about
saving wasted energy so design a flowchart
for Arduino control circuit to save the
consumed energy in electric power circuit .
Note : an ideal electric system has power
factor PF=0.999 and very low reactive
power. using loops and previous concepts
as logical operators and conditional
statements beside a function with
parameters , calling it to complete a
program / project. Eng. and Educator Osama Ghandour
Python
Rubaric
Blue
student differentiate between / using different types of
Loops with examples.
Green
student differentiate between / use using different
types of Loops .
Yello
w
student mention features / use one of type of loops .
Read student don`t have any idea loops .
Eng. and Educator Osama
Ghandour
Python
Resources
• https://www.youtube.com/watch?v=Rtww83GH
0BU
• https://www.w3schools.com/python/python_arra
ys.asp
• Other materials:
• https://www.sololearn.com
• https://www.w3schools.com
• www.python.org
Eng. and Educator Osama
Ghandour
Python
Textbook and Resource
Materials:
https://www.w3schools.com/python/pyth
on_dictionaries.asp
https://www.w3schools.com/python/pyth
on_functions.asp
.
Eng. & Educator Osama
Ghandour
Learn and practice through on line web sites
https://www.thewebevolved.com
https://www.123test.com/
https://www.wscubetech.com/
https://www.w3schools.com/
https://www.guru99.com
https://codescracker.com/exam/review.php
https://www.arealme.com/left-right-brain/en/
https://www.proprofs.com/
https://www.geeksforgeeks.org/
https://www.tutorialspoint.com
https://www.sololearn.com
http://www.littlewebhut.com/
Eng. & Educator Osama
Ghandour
Python
If you do not feel happy, smile
and pretend to be happy.
• Smiling produces seratonin
which is a neurotransmitter
linked with feelings of
happiness
Thanks
Eng. & Educator Osama
Ghandour
Python
https://twitter.com/osamageris
https://www.linkedin.com/in/osamaghandour/
https://www.youtube.com/user/osmgg2
https://www.facebook.com/osama.g.geris
Eng. & Educator Osama
Ghandour
Python

Python week 7 8 2019-2020 for grade 10

  • 1.
    Agenda of LOCS.1.11 W7-8 1- Warm up Revision 10 min 2- ppt teacher demonstrate about Python 15m 3- Video about Python 5min 4- Practical work Students divided in pairs and use Anaconda : Spyder or on line Python platform to create very simple program using python -3.8.1 7 - Questions and answers as pretest about Python 5 m 8-Refelection 5 min 9- Home work 5 min Python Eng. & Educator Osama Ghandour
  • 2.
    LO CS.1.11 W7: Understand and interpret concept the loop statements and give some examples. • Students can design programs involving loop statements. • Gain knowledge and understanding of function of the loops inside the program. • Students can compare between Lesson plan Python Eng. & Educator Osama Ghandour
  • 3.
    Warm Up Listen tothis video Offline On line Python Eng. & Educator Osama Ghandour
  • 4.
    Warm up 5min 1-Using logical operators and give some examples. 2- using & Comparing between if &switch statements and give some examples. 3- Write the general syntax of the conditional statements (if& switch). Eng. & Educator Osama Ghandour Python
  • 5.
    Warm up inpython . Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 6.
    6 if  If statement:Executes a group of statements only if a certain condition is true. Otherwise, the statements are skipped.  Syntax: if condition: statements  Example: gpa = 3.4 if gpa > 2.0: print "Your application is accepted." Eng. & Educator Osama Ghandour
  • 7.
    7 if/else  if/else statement:Executes one block of statements if a certain condition is True, and a second block of statements if it is False.  Syntax: if condition: statements else: statements  Example: gpa = 1.4 if gpa > 2.0: print "Welcome to Mars University!" else: print "Your application is denied."  Multiple conditions can be chained with elif ("else if"): if condition: statements elif condition: statements else: statements Eng. & Educator Osama Ghandour
  • 8.
    8 while  while loop:Executes a group of statements as long as a condition is True.  good for indefinite loops (repeat an unknown number of times)  Syntax: while condition: statements  Example: number = 1 while number < 200: print number, number = number * 2  Output: 1 2 4 8 16 32 64 128 Eng. & Educator Osama Ghandour
  • 9.
    9 Relational VS Logic Many logical expressions use relational operators:  Logical expressions can be combined with logical operators:  Exercise: Write code to display and count the factors of a number. Operator Example Result and 9 != 6 and 2 < 3 True or 2 == 3 or -1 < 5 True not not 7 > 0 False Operator Meaning Example Result == equals 1 + 1 == 2 True != does not equal 3.2 != 2.5 True < less than 10 < 5 False > greater than 10 > 5 True <= less than or equal to 126 <= 100 False >= greater than or equal to 5.0 >= 5.0 True Eng. & Educator Osama Ghandour
  • 10.
  • 11.
    Further programming • Labexercises – Let's go downstairs to the basement computer labs! • - learn prcticaly • What next? – Lists , Dictionaries , Algorithms etc. Eng. & Educator Osama Ghandour
  • 12.
  • 13.
    Essential Questions • EssentialQuestions: 1- What is the function of the loop statement? 2- What is the general syntax of the loop statements? Eng. & Educator Osama Ghandour
  • 14.
    Essential Questions • EssentialQuestions: 3- Write a code to repeat a text "Egypt" 5 times. 4- Write a code to display the odd, even numbers from 0 to 10 and their sum. Eng. & Educator Osama Ghandour
  • 15.
    Essential Questions • EssentialQuestions: 5- Write a code to display the integer numbers between 1 to 100 divisible by 7 Eng. & Educator Osama Ghandour
  • 16.
    16 while  while loop:Executes a group of statements as long as a condition is True.  good for indefinite loops (repeat an unknown number of times)  Syntax: while condition: statements  Example: number = 1 while number < 200: print number, number = number * 2  Output: 1 2 4 8 16 32 64 128 Eng. & Educator Osama Ghandour Iteration Loop structure
  • 17.
  • 18.
    Types of loopsin python for loop using range() function to write even and odd numbers . Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 19.
    For loop sume =0 sumo = 0 for x in range (11): if x%2==0: print (x , "is even number") sume=sume+x else : print (x , "is odd number") sumo=sumo+x print (sume , "summestion of even numbers") print (sumo , "summestion of odd numbers") Eng. & Educator Osama Ghandour
  • 20.
    • 0 iseven number • 1 is odd number • 2 is even number • 3 is odd number • 4 is even number • 5 is odd number • 6 is even number • 7 is odd number • 8 is even number • 9 is odd number • 10 is even number • 30 summestion of even numbers • 25 summestion of odd numbers Eng. & Educator Osama Ghandour
  • 21.
    Eng. & EducatorOsama Ghandour
  • 22.
    Types of loopsin python for loop using range() function to write integer numbers divided by 7 . Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 23.
    Evidence of Learning: Createa project with a programming language “Python” using different types of Loops. Eng. & Educator Osama Ghandour
  • 24.
    Connection to math Eng.& Educator Osama Ghandour Create, interpret and analyze quadratic functions that model real-world situations. W1-4 Key Concepts: o 1. Quadratic Function o 2. First and second differences o 3. Completing the square o 4. Complex numbers o 5. Parabola o 6. Focus o 7. Argand diagram o 8. related roots
  • 25.
    Mechanics Eng. & EducatorOsama Ghandour Learning Outcome: Use position, displacement, average and instantaneous velocity, average and instantaneous acceleration to describe 1-dimensional motion of an object. W1-3 Key Concepts: o 1. Position /Time graphs o 2. velocity/Time graphs o 3. Acceleration /Time graphs o 4. Relative velocity. o 5. Instantaneous velocity o 6. Average velocity o 7. Reference Frames
  • 26.
    Mechanics Eng. & EducatorOsama Ghandour Week 04 - Week 08 Learning Outcome: Use kinematic equations to understand and predict 1-dimensional motion of objects under constant acceleration,including vertical (free-fall) motion under gravity. Key Concepts:  1. Area under a curve  2. Kinematic equations for 1-D motion with constant acceleration  3. Free-fall motion
  • 27.
    Physics • . Fluidsw1-3 • 2. Pressure • 3. Manometer • 4. Pressure gauge • 5. Units of pressure • 6. Effect of atmospheric pressure on boiling point of water • 7. Change in atmospheric pressure with altitude • 8. Pressure difference and force • 9. Archimedes Principle Eng. & Educator Osama Ghandour
  • 28.
    Check your emailto Solve the Online auto answered quiz 15 min after school the quiz will be closed in 10:00pm after tomorrow Eng. & Educator Osama Ghandour Python
  • 29.
    Repetition (loops) in Python. Listento this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 30.
    Read /write toArduino pins Eng. & Educator Osama Ghandour
  • 31.
    Now you canplug the usb cable Eng. & Educator Osama Ghandour
  • 32.
    Run Arduino UNOwith PyFirmata library Eng. & Educator Osama Ghandour
  • 33.
    Eng. & EducatorOsama Ghandour
  • 34.
    Eng. & EducatorOsama Ghandour
  • 35.
    Communicate with standardFirmata as downloading it to Arduino Eng. & Educator Osama Ghandour
  • 36.
    Now you canun plug Eng. & Educator Osama Ghandour
  • 37.
    Eng. & EducatorOsama Ghandour
  • 38.
    Eng. & EducatorOsama Ghandour
  • 39.
    Eng. & EducatorOsama Ghandour
  • 40.
    Eng. & EducatorOsama Ghandour
  • 41.
    Arduino Temperature control Eng.& Educator Osama Ghandour
  • 42.
    Eng. & EducatorOsama Ghandour
  • 43.
    Eng. & EducatorOsama Ghandour
  • 44.
    Eng. & EducatorOsama Ghandour
  • 45.
    Summary 1-Types of Loops. 2-while loop. 3- for loop 4-Loop control statement (start, end and step). 5- Control all loops by break & continue statements. 6- Infinite loop Eng. & Educator Osama Ghandour Python
  • 46.
    Prepare for nextweek According to student’s law Gn=Wn % Ng CS.1.07 - 1- Gain knowledge and understanding the meaning of computer language? 2- Draw conclusions about concepts Eng. & Educator Osama Ghandour Python
  • 47.
    Reflection • Mention 2things you learned today • What is your goal to accomplish in next week end in programming using Loops in Python? Eng. and Educator Osama Ghandour Python
  • 48.
    Home work (s.proj.) 1 you studied in physics about electric power and in your capstone about saving wasted energy so design a flowchart for Arduino control circuit to save the consumed energy in electric power circuit . Note : an ideal electric system has power factor PF=0.999 and very low reactive power. using loops and previous concepts as logical operators and conditional statements beside a function with parameters , calling it to complete a program / project. Eng. and Educator Osama Ghandour Python
  • 49.
    Rubaric Blue student differentiate between/ using different types of Loops with examples. Green student differentiate between / use using different types of Loops . Yello w student mention features / use one of type of loops . Read student don`t have any idea loops . Eng. and Educator Osama Ghandour Python
  • 50.
    Resources • https://www.youtube.com/watch?v=Rtww83GH 0BU • https://www.w3schools.com/python/python_arra ys.asp •Other materials: • https://www.sololearn.com • https://www.w3schools.com • www.python.org Eng. and Educator Osama Ghandour Python
  • 51.
  • 52.
    Learn and practicethrough on line web sites https://www.thewebevolved.com https://www.123test.com/ https://www.wscubetech.com/ https://www.w3schools.com/ https://www.guru99.com https://codescracker.com/exam/review.php https://www.arealme.com/left-right-brain/en/ https://www.proprofs.com/ https://www.geeksforgeeks.org/ https://www.tutorialspoint.com https://www.sololearn.com http://www.littlewebhut.com/ Eng. & Educator Osama Ghandour Python
  • 53.
    If you donot feel happy, smile and pretend to be happy. • Smiling produces seratonin which is a neurotransmitter linked with feelings of happiness
  • 54.
    Thanks Eng. & EducatorOsama Ghandour Python
  • 55.