SlideShare a Scribd company logo
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 Why Python
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
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
output
source code
Hello.java
byte code
Hello.class
interpret
output
source 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
Python Basics .
Listen to this video
Offline On line
Eng. & Educator Osama
Ghandour
Python
Data Types .
Listen to this video
Offline On line
Eng. & Educator Osama
Ghandour
Python
Data Types in
programming.
Listen to this video
Offline On line
Eng. & Educator Osama
Ghandour
Python
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.
Listen to this video
Offline On line
Eng. & Educator Osama
Ghandour
Python
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
tomorrow
Eng. & Educator Osama
Ghandour
Python
Repetition (loops) in
Python.
Listen to this video
Offline On line
Eng. & Educator Osama
Ghandour
Python
Selection (if/else) in
Python
Listen to this video
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 concepts
Eng. & 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
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 (20)

PPT
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Osama Ghandour Geris
 
PPT
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
PDF
Chapter 0 Python Overview (Python Programming Lecture)
IoT Code Lab
 
PDF
Introduction to python programming
Srinivas Narasegouda
 
PPTX
Introduction to Python Programming
Akhil Kaushik
 
PDF
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Universitat Politècnica de Catalunya
 
PDF
Attention mechanisms with tensorflow
Keon Kim
 
PPTX
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Maulik Borsaniya
 
DOCX
PYTHON NOTES
Ni
 
PDF
Py tut-handout
Ramachandra Dama
 
PDF
Text Classification Powered by Apache Mahout and Lucene
lucenerevolution
 
PPTX
Recurrent Neural Networks for Text Analysis
odsc
 
PPTX
About Python Programming Language | Benefit of Python
Information Technology
 
PPTX
Python programming introduction
Siddique Ibrahim
 
PPTX
Python basics
Jyoti shukla
 
PDF
String handling(string buffer class)
Ravi Kant Sahu
 
PPTX
Knowledge Extraction
Pierre de Lacaze
 
PDF
Deep learning for NLP and Transformer
Arvind Devaraj
 
PDF
Introduction to Transformers for NLP - Olga Petrova
Alexey Grigorev
 
PPTX
2019 session 6 develop programs to solve a variety of problems in math , phys...
Osama Ghandour Geris
 
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Osama Ghandour Geris
 
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Chapter 0 Python Overview (Python Programming Lecture)
IoT Code Lab
 
Introduction to python programming
Srinivas Narasegouda
 
Introduction to Python Programming
Akhil Kaushik
 
Attention-based Models (DLAI D8L 2017 UPC Deep Learning for Artificial Intell...
Universitat Politècnica de Catalunya
 
Attention mechanisms with tensorflow
Keon Kim
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Maulik Borsaniya
 
PYTHON NOTES
Ni
 
Py tut-handout
Ramachandra Dama
 
Text Classification Powered by Apache Mahout and Lucene
lucenerevolution
 
Recurrent Neural Networks for Text Analysis
odsc
 
About Python Programming Language | Benefit of Python
Information Technology
 
Python programming introduction
Siddique Ibrahim
 
Python basics
Jyoti shukla
 
String handling(string buffer class)
Ravi Kant Sahu
 
Knowledge Extraction
Pierre de Lacaze
 
Deep learning for NLP and Transformer
Arvind Devaraj
 
Introduction to Transformers for NLP - Olga Petrova
Alexey Grigorev
 
2019 session 6 develop programs to solve a variety of problems in math , phys...
Osama Ghandour Geris
 

Similar to Python week 1 2020-2021 (20)

PPTX
Python programming language presentation
dhanishev1
 
PDF
01a-Introduction. pds.pdf
AaronJasonBaptist1
 
PPTX
Lecture1_introduction to python.pptx
MohammedAlYemeni1
 
PDF
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
PPT
01 introduction to cpp
Manzoor ALam
 
PPTX
Module 1 - Programming Fundamentals.pptx
GaneshRaghu4
 
PDF
introduction to python programming course
FarhadMohammadRezaHa
 
PDF
Python for Physical Science.pdf
MarilouANDERSON
 
PPTX
Python-Beginer-PartOnePython is one of the top programming languages in the w...
ahmedosman389
 
PPTX
Python programming workshop session 1
Abdul Haseeb
 
PDF
Intro to Python for Non-Programmers
Ahmad Alhour
 
PPTX
Java Programming Course for beginners -الدسوقي
kareemtarek40
 
PDF
Autonomous Machines with Project Bonsai
Ivo Andreev
 
PPT
270_1_CIntro_Up_To_Functions.ppt
Alefya1
 
PPT
Survey of programming language getting started in C
ummeafruz
 
PPT
270 1 c_intro_up_to_functions
ray143eddie
 
PPT
270_1_CIntro_Up_To_Functions.ppt
UdhayaKumar175069
 
PPT
ch01-basic-java-programs.ppt
Mahyuddin8
 
PPTX
Begin with c++ Fekra Course #1
Amr Alaa El Deen
 
PPT
CIntro_Up_To_Functions.ppt;uoooooooooooooooooooo
muhammedcti23240202
 
Python programming language presentation
dhanishev1
 
01a-Introduction. pds.pdf
AaronJasonBaptist1
 
Lecture1_introduction to python.pptx
MohammedAlYemeni1
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
01 introduction to cpp
Manzoor ALam
 
Module 1 - Programming Fundamentals.pptx
GaneshRaghu4
 
introduction to python programming course
FarhadMohammadRezaHa
 
Python for Physical Science.pdf
MarilouANDERSON
 
Python-Beginer-PartOnePython is one of the top programming languages in the w...
ahmedosman389
 
Python programming workshop session 1
Abdul Haseeb
 
Intro to Python for Non-Programmers
Ahmad Alhour
 
Java Programming Course for beginners -الدسوقي
kareemtarek40
 
Autonomous Machines with Project Bonsai
Ivo Andreev
 
270_1_CIntro_Up_To_Functions.ppt
Alefya1
 
Survey of programming language getting started in C
ummeafruz
 
270 1 c_intro_up_to_functions
ray143eddie
 
270_1_CIntro_Up_To_Functions.ppt
UdhayaKumar175069
 
ch01-basic-java-programs.ppt
Mahyuddin8
 
Begin with c++ Fekra Course #1
Amr Alaa El Deen
 
CIntro_Up_To_Functions.ppt;uoooooooooooooooooooo
muhammedcti23240202
 
Ad

More from Osama Ghandour Geris (20)

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

Recently uploaded (20)

PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 

Python week 1 2020-2021

  • 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 Why Python 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 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 output source code Hello.java byte code Hello.class interpret output source 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. Python Basics . Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 16. Data Types . Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 17. Data Types in programming. Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 18. 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
  • 19. Variables. Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 20. 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
  • 21. 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
  • 22. •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
  • 23. Eng. & Educator Osama Ghandour
  • 24. Repetition (loops) and Selection (if/else) What we will Learn today ?
  • 25. Donkey work = repetition = iteration – loops – inside it there are conditions
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. 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
  • 33. Repetition (loops) in Python. Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 34. Selection (if/else) in Python Listen to this video Offline On line Eng. & Educator Osama Ghandour Python
  • 35. Summary 1-Repetition (loops). 2- Selection (if/else). 3- Compile the program (Run). Eng. & Educator Osama Ghandour Python
  • 36. 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
  • 37. Reflection • What is your goal to accomplish in next week End Using Python? Eng. and Educator Osama Ghandour Python
  • 38. 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
  • 39. 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
  • 40. 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
  • 41. 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
  • 42. 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
  • 43. If you do not feel happy, smile and pretend to be happy. • Smiling produces seratonin which is a neurotransmitter linked with feelings of happiness
  • 44. Thanks Eng. & Educator Osama Ghandour Python