Grade 7-Unit 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 40

UNIT 1

INTRODUCTION
TO PYTHON,
PYCHARM AND
ALGORITHMS

Teacher : Aboubakr Soultan


Design Technology
LEARNING
OUTCOMES
KEY
WORDS
KEYWORDS
KEY WORDS
Introduction to Programming
• Computers are used in our everyday lives
• Mobile phones, games consoles, laptops and tablets are
all computers
• Computers can only work when you tell them what to do
• To this we need to talk to the computer in a language
that the computer can understand
• We use programming languages to create programs that
the computer can understand and run
Activity -1
(pg :17)
• Discussing current and Future job roles
• Look at the job roles n the table below
• Think about what these job roles are now
• What do you think will be different about these
jobs in future ?
Job role The job role now The job role in future

Computer scientist Uses technology to solve problems. Writes programs and code Any answer that builds upon the current job role and
to make tasks easier on computers, smartphones, etc. considers future improvements in technology.

Engineer Works in many fields to analyse, develop and evaluate systems, Any answer that builds upon the current job role and
to make new systems or improve existing systems. considers future improvements in technology.

Information technologist Supports company computer systems for different types of Any answer that builds upon the current job role and
companies. Needs knowledge of technology, databases, considers future improvements in technology.
computers and security.
Activity 2
(Pg-18)
• Complete the table in pairs
• Can you name three different
computers in your house ?
• Write your answers below
Why
programming is
important ?
Programming teaches you
important skills such as
• problem solving
• breaking down a big
problem into smaller
ones and finding ways to
solve these problems
A brief history of programming
A BRIEF
HISTORY OF
PROGRAMMING
Pg :20

Ada Lovelace
Short code

C
C# Java Python

Python
Algorithms

When you write a computer We create a solution to the problem The list of steps is called algorithm
program, you are solving a problem by breaking it down into simple
steps before writing the code
CAN YOU WRITE AN ALGORITHM FOR
MAKING A CUP OF COFFEE ?
Activity 4- pg 22
• Match the pictures
below to the correct
type of algorithm
Activity 6- Pg :23
• Write your algorithm to make a cup of tea
• Remember each answer is different , you might have
more steps or less steps than your friend
Python

Python is a It is a very powerful


programming language programming language
that is used by many that can be used to
organizations such as write your own program
YouTube and NASA. and even Google Apps.
Python

It is one of the easiest programming languages to


learn

The syntax(words and symbols used to write the


code) is simple & easy to learn
PyCharm

To make the
programming easier, an
(Integrated development
Environment ) IDE is
used

This helps us in finding


The IDE we will be using
errors, correcting errors
is called PyCharm
and debugging programs
ACTIVITY
7- PG:24
Activity 7- Pg:24
• 1. Open the PyCharm IDE
• Click file >New project
• Change the name of the project from
untitled to your name
• Click File > New .. >Python File and give it
a name : hello world
TYPE THE FOLLOWING ON THE PAGE EXACTLY
RIGHT
CLICK AND
PRESS RUN
“HELLO
WORLD”
The output from the program will be
displayed at the bottom of the screen
You should get the following result

• What did the print ( ) function do in


this program ?

The print function


displayed the text
between the brackets –
hello world
Error handling
• Try this in your program. What is the result ?
• Print ( hello world )
• If you see any red lines under the code like this :
• This means the code is not correct
• If we try to run the code with red lines we will get an error
• A syntax error means there is a problem with the codes and symbols used in the
code
• Finding errors in your code is called debugging
Activity 8- Pg :29

Invalid syntax, function


missing

Closing bracket and double quotes


missing

Double quotes inside the brackets are


missing
Translating an 1. Wake up at 6 O’clock
algorithm into a 2. Slowly walk towards the bathroom
flowchart and 3. Brush your teeth and have a shower
4. Put your school cloths on and get ready.
code 5. Have your breakfast
6. While having breakfast, make sure you don't spill
anything
Activity 9- Translating an algorithm 7. Get your school bag organized and make sure
into code (Pg 30) you have everything needed for ICT and the
other subjects
Write an algorithm for getting ready
for school in the morning 8. Mess around until your school bus arrives and
keep checking if it arrives
9. If it arrives, than run to the bus [if it does not
than keep repeating step 10]
10. Go to school
11. Get ready to repeat the algorithm for tomorrow
Flow chart
A flowchart is used to show an algorithm as a diagram. There
are certain shapes that must be used for this. All shapes are
connected with arrows
Activity 10- Pg :31
• Draw a flowchart for the algorithm you have just written
• Use a new output box
• You will not need the process or decision shapes yet
Run your program .What is the output ? (Pg :32)
Formatting
• Formatting is used to make your
output look neat and tidy.
• This will make it easy to read
Activity 12 –(Pg :33)
Using the formatting commands, write a description
about yourself
Popquiz-unit 1
Pg: 34

You might also like