SlideShare a Scribd company logo
1 of 41
Agenda of LO CS.1.07 W1
1- Warm up about programming 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.07 W1 - Gain
knowledge and understanding
the meaning of computer
language? 2- Draw conclusions
about concepts: data types,
variables, Conditional
statements, looping statements,
functions and Object Oriented
Programming. Lesson plan
Python
Eng. & Educator Osama
Ghandour
Warm Up
Listen to this video
Offline
On line
Python
Eng. & Educator Osama
Ghandour
Essential Question
1- What is meant
by programming
language and give
some examples?
Python
Eng. & Educator Osama
Ghandour
Essential Question
What are the key
features or
characteristics
of language?
Python
Eng. & Educator Osama
Ghandour
Warm up 5 min
1. meaning of computer language.
2. data types.
3. Variables.
4-Expressions .
5-Python platforms
Eng. & Educator Osama
Ghandour
Python
Anaconda : Spyder or an on line Python platform
Inputs : 1- though console 2- input message 3- sensors 2- Dataset
Python – Cheat sheets
You can install python-2.7.17 or python-3.8.1
Write Program / Code
Eng. & Educator Osama
Ghandour
Python
Installing Anaconda
Eng. & Educator Osama
Ghandour
Anaconda > Use Spyder
Eng. & Educator Osama
Ghandour
Python
Coding window – Ipython console - Variable explorer
Spyder
Eng. & Educator Osama
Ghandour
• code or source code: The sequence of
instructions in a program.
• syntax: The set of legal structures and
commands that can be used in a particular
programming language.
• output: The messages printed to the user by a
program.
• console: The text box onto which output is
printed.
– Some source code editors pop up the console as
an external window, and others contain their own
console window.
Programming basics
Eng. & Educator Osama
Ghandour
Compiling and interpreting
in Python.
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
Compiling and interpreting
• Many languages require you to compile
(translate) your program into a form that the
machine understands.
• Python is instead directly interpreted into
machine instructions.
compile execute
outputsource code
Hello.java
byte code
Hello.class
interpret
outputsource code
Hello.py
Eng. & Educator Osama
Ghandour
Expressions
• expression: A data value or set of operations to compute
a value.
Examples: 1 + 4 * 3
42
• Arithmetic operators we will use:
– + - * / addition, subtraction/negation, multiplication,
division
– % modulus, a.k.a. remainder
– ** exponentiation
• precedence: Order in which operations are computed.
– * / % ** have a higher precedence than + -
1 + 3 * 4 is 13
– Parentheses can be used to force a certain order of evaluation.
(1 + 3) * 4 is 16
Eng. & Educator Osama
Ghandour
Numbers
• The usual suspects
• 12, 3.14, 0xFF, 0377, (-1+2)*3/4**5, abs(x), 0<x<=5
• C-style shifting & masking
• 1<<16, x&0xff, x|1, ~x, x^y
• Integer division truncates :-(
• 1/2 -> 0 # 1./2. -> 0.5, float(1)/2 -> 0.5
• Will be fixed in the future
• Long (arbitrary precision), complex
• 2L**100 -> 1267650600228229401496703205376L
– In Python 2.2 and beyond, 2**100 does the same thing
• 1j**2 -> (-1+0j) Eng. & Educator Osama
Ghandour
Variables
• variable: A named piece of memory that can store a value.
– Usage:
• Compute an expression's result,
• store that result into a variable,
• and use that variable later in the program.
• assignment statement: Stores a value into a variable.
– Syntax:
name = value
– Examples: x = 5
gpa = 3.14
x 5 gpa 3.14
– A variable that has been given a value can be used in expressions.
x + 4 is 9
• Exercise: Evaluate the quadratic equation for a given a, b, and c.
Eng. & Educator Osama
Ghandour
Syntax:
print "Message"
print Expression
–Prints the given text message or expression value on the
console, and moves the cursor down to the next line.
print Item1, Item2, ..., ItemN
–Prints several messages and/or expressions on the same line.
• Examples:
print "Hello, world!"
age = 45
print "You have", 65 - age, "years until
retirement"
Output:
Hello, world!
You have 20 years until retirement
print
Eng. & Educator Osama
Ghandour
•input : Reads a number from user input.
–You can assign (store) the result of input into a variable.
–Example:
age = input("How old are you? ")
print "Your age is", age
print "You have", 65 - age, "years until
retirement"
Output:
How old are you? 53
Your age is 53
You have 12 years until retirement
• Exercise: Write a Python program that prompts the
user for his/her amount of money, then reports how
many Nintendo Wiis the person can afford, and how
much more money he/she will need to afford an
additional Wii.
Input
Eng. & Educator Osama
Ghandour
Eng. & Educator Osama
Ghandour
Repetition (loops)
and Selection (if/else)
What we will Learn today
?
Donkey work =
repetition = iteration –
loops – inside it there
are conditions
Text processing
• text processing: Examining, editing, formatting text.
– often uses loops that examine the characters of a string
one by one
• A for loop can examine each character in a string in
sequence.
– Example:
for c in "booyah":
print c
Output:
b
o
o
y
a
h
Eng. & Educator Osama
Ghandour
Strings and numbers
• ord(text) - converts a string into a number.
– Example: ord("a") is 97, ord("b") is 98, ...
– Characters map to numbers using standardized mappings such
as ASCII and Unicode.
• chr(number) - converts a number into a string.
– Example: chr(99) is "c"
• Exercise: Write a program that performs a rotation cypher.
– e.g. "Attack" when rotated by 1 becomes "buubdl"
Eng. & Educator Osama
Ghandour
Python
DrawingPanel
• To create a window, create a drawingpanel and
its graphical pen, which we'll call g :
from drawingpanel import *
panel = drawingpanel(width, height)
g = panel.get_graphics()
... (draw shapes here) ...
panel.mainloop()
• The window has nothing on it, but we can draw
shapes and
lines on it by sending commands to g .
– Example:
g.create_rectangle(10, 30, 60, 35)
g.create_oval(80, 40, 50, 70)
g.create_line(50, 50, 90, 70)
Eng. & Educator Osama
Ghandour
Graphical commands
Command Description
g.create_line(x1, y1, x2, y2) a line between (x1, y1), (x2, y2)
g.create_oval(x1, y1, x2, y2) the largest oval that fits in a box with
top-left corner at (x1, y1) and
bottom-left corner at (x2, y2)
g.create_rectangle(x1, y1, x2, y2) the rectangle with top-left corner at
(x1, y1), bottom-left at (x2, y2)
g.create_text(x, y, text="text") the given text at (x, y)
• The above commands can accept optional outline and fill
colors.
g.create_rectangle(10, 40, 22, 65,
fill="red", outline="blue")
• The coordinate system is y-inverted:(0, 0)
(200, 100)
Eng. & Educator Osama
Ghandour
Drawing with loops
• We can draw many repetitions of the same
item at different x/y positions with for loops.
– The x or y assignment expression contains the
loop counter, i, so that in each pass of the loop,
when i changes, so does x or y.
from drawingpanel import *
window = drawingpanel(500, 400)
g = window.get_graphics()
for i in range(1, 11):
x = 100 + 20 * i
y = 5 + 20 * i
g.create_oval(x, y, x + 50, y + 50, fill="red")
window.mainloop()
• Exercise: Draw the figure at right.
Eng. & Educator Osama
Ghandour
Further programming
• Lab exercises
– Let's go downstairs to the basement computer
labs!
– All resources are available at the following URL:
• http://faculty.washington.edu/stepp/cs4hs/
• What next?
– Lists , Dictionaries , data structures
– Algorithms: searching, sorting, recursion, etc.
– Objects and object-oriented programming
– Graphical user interfaces, event-driven
programming 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
tomorrowEng. & Educator Osama
Ghandour
Python
Repetition (loops) in
Python.
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
Selection (if/else) in
Python
Listen to this video
Offline On line
Offline On line
Eng. & Educator Osama
Ghandour
Python
Summary
1-Repetition (loops).
2- Selection (if/else).
3- Compile the program (Run).
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 conceptsEng. & Educator Osama
Ghandour
Python
Reflection
• What is your goal to accomplish in
next week End Using Python?
Eng. and Educator Osama
Ghandour
Python
Home work (s. proj.) 1
• Create a presentation contains some
concepts of computer languages (Python)
and display the Concepts of Repetition
(loops) and Selection (if/else)following the
bellow rubric .
Eng. and Educator Osama
Ghandour
Python
Rubaric
Blue
Design a presentation showing Python to contain some
concepts Repetition (loops)
and Selection (if/else)
Green
Design a presentation showing Python to contain one or
2 Repetition (loops) and Selection (if/else).
Yello
w
missing two points of green level.
Read No presentation .
Eng. and Educator Osama
Ghandour
Python
Resources
• https://www.youtube.com/watch?v=Rtww83GH
0BU
• Other materials:
• https://www.sololearn.com
• https://www.w3schools.com
• www.python.org
Eng. and Educator Osama
Ghandour
Python
Resources
• https://www.youtube.com/user/osmgg2
Other materials:
• https://www.sololearn.com
• https://www.w3schools.com
• www.python.org
• “Learning Python,” 2nd edition, Mark Lutz
and David Ascher (O'Reilly, Sebastopol, CA,
2004) (Thorough. Hard to get into as a quick
read)
Eng. & Educator Osama
Ghandour
Python
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
Engineer and educator/ Osama G. Geris
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

More Related Content

What's hot

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programmingSrinivas Narasegouda
 
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...Universitat Politècnica de Catalunya
 
Autoencoders
AutoencodersAutoencoders
AutoencodersCloudxLab
 
Python教程 / Python tutorial
Python教程 / Python tutorialPython教程 / Python tutorial
Python教程 / Python tutorialee0703
 
Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)IoT Code Lab
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflowKeon Kim
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Transfer learning, active learning using tensorflow object detection api
Transfer learning, active learning  using tensorflow object detection apiTransfer learning, active learning  using tensorflow object detection api
Transfer learning, active learning using tensorflow object detection api설기 김
 
2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...Osama Ghandour Geris
 
Code Craft - A game-based approach for teaching introductory programming
Code Craft - A game-based approach for teaching introductory programming Code Craft - A game-based approach for teaching introductory programming
Code Craft - A game-based approach for teaching introductory programming Zaher Wanli
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Edureka!
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
 
Recurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text AnalysisRecurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text Analysisodsc
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Edureka!
 
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsPython for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsRoelof Pieters
 
孫民/從電腦視覺看人工智慧 : 下一件大事
孫民/從電腦視覺看人工智慧 : 下一件大事孫民/從電腦視覺看人工智慧 : 下一件大事
孫民/從電腦視覺看人工智慧 : 下一件大事台灣資料科學年會
 
About Python Programming Language | Benefit of Python
About Python Programming Language | Benefit of PythonAbout Python Programming Language | Benefit of Python
About Python Programming Language | Benefit of PythonInformation Technology
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTESNi
 

What's hot (20)

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
 
Autoencoders
AutoencodersAutoencoders
Autoencoders
 
Python教程 / Python tutorial
Python教程 / Python tutorialPython教程 / Python tutorial
Python教程 / Python tutorial
 
Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)Chapter 0 Python Overview (Python Programming Lecture)
Chapter 0 Python Overview (Python Programming Lecture)
 
Attention mechanisms with tensorflow
Attention mechanisms with tensorflowAttention mechanisms with tensorflow
Attention mechanisms with tensorflow
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Transfer learning, active learning using tensorflow object detection api
Transfer learning, active learning  using tensorflow object detection apiTransfer learning, active learning  using tensorflow object detection api
Transfer learning, active learning using tensorflow object detection api
 
2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...
 
Code Craft - A game-based approach for teaching introductory programming
Code Craft - A game-based approach for teaching introductory programming Code Craft - A game-based approach for teaching introductory programming
Code Craft - A game-based approach for teaching introductory programming
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Recurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text AnalysisRecurrent Neural Networks for Text Analysis
Recurrent Neural Networks for Text Analysis
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
 
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsPython for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
 
What is Python?
What is Python?What is Python?
What is Python?
 
孫民/從電腦視覺看人工智慧 : 下一件大事
孫民/從電腦視覺看人工智慧 : 下一件大事孫民/從電腦視覺看人工智慧 : 下一件大事
孫民/從電腦視覺看人工智慧 : 下一件大事
 
About Python Programming Language | Benefit of Python
About Python Programming Language | Benefit of PythonAbout Python Programming Language | Benefit of Python
About Python Programming Language | Benefit of Python
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTES
 

Similar to Python week 2 2019 2020 for g10 by eng.osama ghandour

Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.pptPython week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.pptOsama Ghandour Geris
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonmckennadglyn
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cppManzoor ALam
 
Python for Physical Science.pdf
Python for Physical Science.pdfPython for Physical Science.pdf
Python for Physical Science.pdfMarilouANDERSON
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.pptMahyuddin8
 
Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1Amr Alaa El Deen
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptxMohammedAlYemeni1
 
Module 1 - Programming Fundamentals.pptx
Module 1 - Programming Fundamentals.pptxModule 1 - Programming Fundamentals.pptx
Module 1 - Programming Fundamentals.pptxGaneshRaghu4
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-ProgrammersAhmad Alhour
 
Py4 inf 01-intro
Py4 inf 01-introPy4 inf 01-intro
Py4 inf 01-introIshaq Ali
 
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandourPython cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandourOsama Ghandour Geris
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdflailoesakhan
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.pptUdhayaKumar175069
 
Survey of programming language getting started in C
Survey of programming language getting started in CSurvey of programming language getting started in C
Survey of programming language getting started in Cummeafruz
 
270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functions270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functionsray143eddie
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.pptAlefya1
 

Similar to Python week 2 2019 2020 for g10 by eng.osama ghandour (20)

Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.pptPython week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
 
Python for Physical Science.pdf
Python for Physical Science.pdfPython for Physical Science.pdf
Python for Physical Science.pdf
 
py4inf-01-intro.ppt
py4inf-01-intro.pptpy4inf-01-intro.ppt
py4inf-01-intro.ppt
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.ppt
 
Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1
 
ForLoops.pptx
ForLoops.pptxForLoops.pptx
ForLoops.pptx
 
python.pdf
python.pdfpython.pdf
python.pdf
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptx
 
Module 1 - Programming Fundamentals.pptx
Module 1 - Programming Fundamentals.pptxModule 1 - Programming Fundamentals.pptx
Module 1 - Programming Fundamentals.pptx
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
 
Py4 inf 01-intro
Py4 inf 01-introPy4 inf 01-intro
Py4 inf 01-intro
 
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandourPython cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandour
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 
Survey of programming language getting started in C
Survey of programming language getting started in CSurvey of programming language getting started in C
Survey of programming language getting started in C
 
270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functions270 1 c_intro_up_to_functions
270 1 c_intro_up_to_functions
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 

More from Osama Ghandour Geris

functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...Osama Ghandour Geris
 
Mobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osamaMobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osamaOsama Ghandour Geris
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourOsama Ghandour Geris
 
How to print a sketch up drawing in 3d
How to print a sketch up drawing  in 3dHow to print a sketch up drawing  in 3d
How to print a sketch up drawing in 3dOsama Ghandour Geris
 
7 types of presentation styles on line
7 types of presentation styles on line7 types of presentation styles on line
7 types of presentation styles on lineOsama Ghandour Geris
 
Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020Osama Ghandour Geris
 
2019 numbering systems decimal binary octal hexadecimal
2019 numbering systems decimal   binary octal hexadecimal2019 numbering systems decimal   binary octal hexadecimal
2019 numbering systems decimal binary octal hexadecimalOsama Ghandour Geris
 

More from Osama Ghandour Geris (20)

functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
 
Mobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osamaMobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osama
 
6 css week12 2020 2021 for g10
6 css week12 2020 2021 for g106 css week12 2020 2021 for g10
6 css week12 2020 2021 for g10
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
 
Cooding history
Cooding history Cooding history
Cooding history
 
Computer networks--network
Computer networks--networkComputer networks--network
Computer networks--network
 
How to print a sketch up drawing in 3d
How to print a sketch up drawing  in 3dHow to print a sketch up drawing  in 3d
How to print a sketch up drawing in 3d
 
Google sketch up-tutorial
Google sketch up-tutorialGoogle sketch up-tutorial
Google sketch up-tutorial
 
7 types of presentation styles on line
7 types of presentation styles on line7 types of presentation styles on line
7 types of presentation styles on line
 
Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020
 
Php introduction
Php introductionPhp introduction
Php introduction
 
How to use common app
How to use common appHow to use common app
How to use common app
 
Creating databases using xampp w2
Creating databases using xampp w2Creating databases using xampp w2
Creating databases using xampp w2
 
warm up cool down
warm  up cool down warm  up cool down
warm up cool down
 
Flow charts week 5 2020 2021
Flow charts week 5 2020  2021Flow charts week 5 2020  2021
Flow charts week 5 2020 2021
 
Xamppinstallation edited
Xamppinstallation editedXamppinstallation edited
Xamppinstallation edited
 
Bloom s three pyramids
Bloom s three pyramidsBloom s three pyramids
Bloom s three pyramids
 
The learning experiences ladder
The learning experiences ladderThe learning experiences ladder
The learning experiences ladder
 
2019 numbering systems decimal binary octal hexadecimal
2019 numbering systems decimal   binary octal hexadecimal2019 numbering systems decimal   binary octal hexadecimal
2019 numbering systems decimal binary octal hexadecimal
 
Inquiry ibl project
Inquiry ibl projectInquiry ibl project
Inquiry ibl project
 

Recently uploaded

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 

Recently uploaded (20)

FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

Python week 2 2019 2020 for g10 by eng.osama ghandour

  • 1. Agenda of LO CS.1.07 W1 1- Warm up about programming 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.07 W1 - Gain knowledge and understanding the meaning of computer language? 2- Draw conclusions about concepts: data types, variables, Conditional statements, looping statements, functions and Object Oriented Programming. Lesson plan Python Eng. & Educator Osama Ghandour
  • 3. Warm Up Listen to this video Offline On line Python Eng. & Educator Osama Ghandour
  • 4. Essential Question 1- What is meant by programming language and give some examples? Python Eng. & Educator Osama Ghandour
  • 5. Essential Question What are the key features or characteristics of language? Python Eng. & Educator Osama Ghandour
  • 6. Warm up 5 min 1. meaning of computer language. 2. data types. 3. Variables. 4-Expressions . 5-Python platforms Eng. & Educator Osama Ghandour Python
  • 7. Anaconda : Spyder or an on line Python platform Inputs : 1- though console 2- input message 3- sensors 2- Dataset Python – Cheat sheets You can install python-2.7.17 or python-3.8.1 Write Program / Code Eng. & Educator Osama Ghandour Python
  • 8. Installing Anaconda Eng. & Educator Osama Ghandour
  • 9. Anaconda > Use Spyder Eng. & Educator Osama Ghandour Python
  • 10. Coding window – Ipython console - Variable explorer Spyder Eng. & Educator Osama Ghandour
  • 11. • code or source code: The sequence of instructions in a program. • syntax: The set of legal structures and commands that can be used in a particular programming language. • output: The messages printed to the user by a program. • console: The text box onto which output is printed. – Some source code editors pop up the console as an external window, and others contain their own console window. Programming basics Eng. & Educator Osama Ghandour
  • 12. Compiling and interpreting in Python. Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 13. Compiling and interpreting • Many languages require you to compile (translate) your program into a form that the machine understands. • Python is instead directly interpreted into machine instructions. compile execute outputsource code Hello.java byte code Hello.class interpret outputsource code Hello.py Eng. & Educator Osama Ghandour
  • 14. Expressions • expression: A data value or set of operations to compute a value. Examples: 1 + 4 * 3 42 • Arithmetic operators we will use: – + - * / addition, subtraction/negation, multiplication, division – % modulus, a.k.a. remainder – ** exponentiation • precedence: Order in which operations are computed. – * / % ** have a higher precedence than + - 1 + 3 * 4 is 13 – Parentheses can be used to force a certain order of evaluation. (1 + 3) * 4 is 16 Eng. & Educator Osama Ghandour
  • 15. Numbers • The usual suspects • 12, 3.14, 0xFF, 0377, (-1+2)*3/4**5, abs(x), 0<x<=5 • C-style shifting & masking • 1<<16, x&0xff, x|1, ~x, x^y • Integer division truncates :-( • 1/2 -> 0 # 1./2. -> 0.5, float(1)/2 -> 0.5 • Will be fixed in the future • Long (arbitrary precision), complex • 2L**100 -> 1267650600228229401496703205376L – In Python 2.2 and beyond, 2**100 does the same thing • 1j**2 -> (-1+0j) Eng. & Educator Osama Ghandour
  • 16. Variables • variable: A named piece of memory that can store a value. – Usage: • Compute an expression's result, • store that result into a variable, • and use that variable later in the program. • assignment statement: Stores a value into a variable. – Syntax: name = value – Examples: x = 5 gpa = 3.14 x 5 gpa 3.14 – A variable that has been given a value can be used in expressions. x + 4 is 9 • Exercise: Evaluate the quadratic equation for a given a, b, and c. Eng. & Educator Osama Ghandour
  • 17. Syntax: print "Message" print Expression –Prints the given text message or expression value on the console, and moves the cursor down to the next line. print Item1, Item2, ..., ItemN –Prints several messages and/or expressions on the same line. • Examples: print "Hello, world!" age = 45 print "You have", 65 - age, "years until retirement" Output: Hello, world! You have 20 years until retirement print Eng. & Educator Osama Ghandour
  • 18. •input : Reads a number from user input. –You can assign (store) the result of input into a variable. –Example: age = input("How old are you? ") print "Your age is", age print "You have", 65 - age, "years until retirement" Output: How old are you? 53 Your age is 53 You have 12 years until retirement • Exercise: Write a Python program that prompts the user for his/her amount of money, then reports how many Nintendo Wiis the person can afford, and how much more money he/she will need to afford an additional Wii. Input Eng. & Educator Osama Ghandour
  • 19. Eng. & Educator Osama Ghandour
  • 20. Repetition (loops) and Selection (if/else) What we will Learn today ?
  • 21. Donkey work = repetition = iteration – loops – inside it there are conditions
  • 22. Text processing • text processing: Examining, editing, formatting text. – often uses loops that examine the characters of a string one by one • A for loop can examine each character in a string in sequence. – Example: for c in "booyah": print c Output: b o o y a h Eng. & Educator Osama Ghandour
  • 23. Strings and numbers • ord(text) - converts a string into a number. – Example: ord("a") is 97, ord("b") is 98, ... – Characters map to numbers using standardized mappings such as ASCII and Unicode. • chr(number) - converts a number into a string. – Example: chr(99) is "c" • Exercise: Write a program that performs a rotation cypher. – e.g. "Attack" when rotated by 1 becomes "buubdl" Eng. & Educator Osama Ghandour Python
  • 24. DrawingPanel • To create a window, create a drawingpanel and its graphical pen, which we'll call g : from drawingpanel import * panel = drawingpanel(width, height) g = panel.get_graphics() ... (draw shapes here) ... panel.mainloop() • The window has nothing on it, but we can draw shapes and lines on it by sending commands to g . – Example: g.create_rectangle(10, 30, 60, 35) g.create_oval(80, 40, 50, 70) g.create_line(50, 50, 90, 70) Eng. & Educator Osama Ghandour
  • 25. Graphical commands Command Description g.create_line(x1, y1, x2, y2) a line between (x1, y1), (x2, y2) g.create_oval(x1, y1, x2, y2) the largest oval that fits in a box with top-left corner at (x1, y1) and bottom-left corner at (x2, y2) g.create_rectangle(x1, y1, x2, y2) the rectangle with top-left corner at (x1, y1), bottom-left at (x2, y2) g.create_text(x, y, text="text") the given text at (x, y) • The above commands can accept optional outline and fill colors. g.create_rectangle(10, 40, 22, 65, fill="red", outline="blue") • The coordinate system is y-inverted:(0, 0) (200, 100) Eng. & Educator Osama Ghandour
  • 26. Drawing with loops • We can draw many repetitions of the same item at different x/y positions with for loops. – The x or y assignment expression contains the loop counter, i, so that in each pass of the loop, when i changes, so does x or y. from drawingpanel import * window = drawingpanel(500, 400) g = window.get_graphics() for i in range(1, 11): x = 100 + 20 * i y = 5 + 20 * i g.create_oval(x, y, x + 50, y + 50, fill="red") window.mainloop() • Exercise: Draw the figure at right. Eng. & Educator Osama Ghandour
  • 27. Further programming • Lab exercises – Let's go downstairs to the basement computer labs! – All resources are available at the following URL: • http://faculty.washington.edu/stepp/cs4hs/ • What next? – Lists , Dictionaries , data structures – Algorithms: searching, sorting, recursion, etc. – Objects and object-oriented programming – Graphical user interfaces, event-driven programming Eng. & Educator Osama Ghandour
  • 28. Check your email to Solve the Online auto answered quiz 15 min after school the quiz will be closed in 10:00pm after tomorrowEng. & Educator Osama Ghandour Python
  • 29. Repetition (loops) in Python. Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 30. Selection (if/else) in Python Listen to this video Offline On line Offline On line Eng. & Educator Osama Ghandour Python
  • 31. Summary 1-Repetition (loops). 2- Selection (if/else). 3- Compile the program (Run). Eng. & Educator Osama Ghandour Python
  • 32. 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 conceptsEng. & Educator Osama Ghandour Python
  • 33. Reflection • What is your goal to accomplish in next week End Using Python? Eng. and Educator Osama Ghandour Python
  • 34. Home work (s. proj.) 1 • Create a presentation contains some concepts of computer languages (Python) and display the Concepts of Repetition (loops) and Selection (if/else)following the bellow rubric . Eng. and Educator Osama Ghandour Python
  • 35. Rubaric Blue Design a presentation showing Python to contain some concepts Repetition (loops) and Selection (if/else) Green Design a presentation showing Python to contain one or 2 Repetition (loops) and Selection (if/else). Yello w missing two points of green level. Read No presentation . Eng. and Educator Osama Ghandour Python
  • 36. Resources • https://www.youtube.com/watch?v=Rtww83GH 0BU • Other materials: • https://www.sololearn.com • https://www.w3schools.com • www.python.org Eng. and Educator Osama Ghandour Python
  • 37. Resources • https://www.youtube.com/user/osmgg2 Other materials: • https://www.sololearn.com • https://www.w3schools.com • www.python.org • “Learning Python,” 2nd edition, Mark Lutz and David Ascher (O'Reilly, Sebastopol, CA, 2004) (Thorough. Hard to get into as a quick read) Eng. & Educator Osama Ghandour Python
  • 38. 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
  • 39. If you do not feel happy, smile and pretend to be happy. • Smiling produces seratonin which is a neurotransmitter linked with feelings of happiness
  • 40. Thanks Engineer and educator/ Osama G. Geris Eng. & Educator Osama Ghandour Python