0% found this document useful (0 votes)
2 views

t-i-1704457923-what-is-python-ks2-information-powerpoint_ver_1

The document provides an introduction to Python, a widely-used programming language created by Guido van Rossum in 1991. It covers Python's features, its open-source nature, and its applications in various fields such as machine learning and web development. Additionally, it includes basic Python terminology and practical coding exercises for beginners.

Uploaded by

Abdul Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

t-i-1704457923-what-is-python-ks2-information-powerpoint_ver_1

The document provides an introduction to Python, a widely-used programming language created by Guido van Rossum in 1991. It covers Python's features, its open-source nature, and its applications in various fields such as machine learning and web development. Additionally, it includes basic Python terminology and practical coding exercises for beginners.

Uploaded by

Abdul Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

An Introduction to Python

You
Whenmay have
you come
think across
of the wordother programming
python, languages
you may imagine in your
a great big
computing lessons.
snake. However, in computing, Python is a programming
language.

However, Python is a text-


Some of based programming
the languages you language.
may be
familiarSo,
withit is more likely
include to look like
block-based
coding.this.
As it is both beginner-friendly and
open-source, Python is one of the
most widely-used programming
Block-based coding could
languages.
look something like this.

Open-source refers to
software or code that is
available for anyone to
access and modify.
Who Created Python?
Unlike many programming languages, Python came from the
mind of just one person.

Python was created by Guido van


Rossum in 1991. It was originally
created as a project to keep him
occupied during his Christmas
holiday.
Fun Fact
Many different people (including
Python got its name from an old
developers, testers and users) have
BBC television comedy sketch
contributed to the development and
series called Monty Python’s Flying
evolution of Python over the years.
Circus, which was one of Guido van
Rossum's favourite programmes as
a child.
Python Now
Since its release in 1991, Python has had many different versions.
These versions contain changes and tweaks to the original
version.

In 2011 the Python Software In 2018, the Python


Foundation was established. Steering Council was
The Python Software introduced. The Python
Foundation is a non-profit Steering Council is a group
organisation that supports the of five individuals (including
development and growth of Python’s creator Guido van
the Python programming Rossum) who make all of
language. It plays an the final decisions
important role in promoting regarding the Python
the use of Python, supporting language.
the people who use it and
ensuring Python continues to
be a popular language for
people to use.
How Does Python Work?
In computer programming, there are two types of languages:
compiled and interpreted.

This means that when you


run Python, the code doesn’t
need to be compiled into
machine code for the
computer or software to
understand. Instead, the code
is directly processed by an
interpreter.
Machine code: a low-level Interpreter: an
programming language interpreter reads and
consisting of binary executes the code line by
numbers (1s and 0s) that a line without the need of
computer canPython is an interpretedtranslating
directly the language
programming
understand. language.into machine code.
What Is Python Used For?
Python can be used for many different types of coding, such as
machine learning, building websites, data analysis and
software testing.

Many of the world’s biggest tech


companies, such as Google,
Netflix
and Amazon, use Python in some
way.
Your favourite apps or websites
may even use Python too!

Machine learning is where


computers use huge
amounts of data to learn
how to do tasks rather
than being programmed to
do them.
Why Is Python Popular?
Python is considered to be a very easy programming language to
learn because of its code readability.

Python can be used for many different


types of programming, as it is a very
versatile language.
The number
Due to the fact
of programmers
that Python isthat use
Python is vast.
considered easyThis
to learn,
meansthere
that are
the lots
Python
of tutorials
community is extremely large.
This bootcamps
and community available
of peopleto
contributes
aid you in
towards
that learning.
the improvement of the
language and also provides support in
the forums.
Code readability means
that the code is easy to
look at and understand.
Get Started with Python
In Python, there are some key terms that are useful to know.
Think of this as a starting point to help you build a glossary of
Python terms.
stri
ng In Python, a string is a sequence of characters. Characters
can be letters, numbers, symbols or even spaces. Strings are used to
represent and manipulate text in a program.
inte
ger An integer is a whole number without a decimal point. It can
be a positive number, a negative number or zero. Integers are used
to represent and perform arithmetic operations using whole numbers.
varia
ble A variable is a piece of data (this can be numbers or
words) that you can alter and change.

float A float is a number that has a decimal point, like 3.14.


boole
an Booleans have two values: true or false. They help the
computer make choices and decisions. True means yes or on and
false means no or off.
Get Started with Python
list A list is a collection of items, similar to a shopping list.
lo
A loop is a way to make the computer do something repeatedly.
op
functi
A function is a mini-program that performs a specific task.
on
if An if statement is a way to make the computer decide what to do
based
onif a condition.
els
e An if else statement is a way to make the computer's actions
flexible based on different situations. You may want to think of it as: if
something is true, do this; otherwise, do that.
pri
nt
In Python, the print function will show a message on the screen.
parenthe
ses
In coding, parentheses refers to brackets.
double
quotes
In coding, double quotes refers to inverted commas.
Get Started with Python
For this activity, you will need to open a software application that
runs Python. This presentation uses Tynker. If you have chosen to
not use Tynker, the activity can still be achieved. However, the
screenshots and instructions may differ slightly.

Pressing this
Play button
will run the
This
Thisis is
the
the
Editor.
File Manager.
This A Python code inputted
is project
where the cancode
consist of one or more into the
This is the Output
should
files, depending
be written, on
to how complex Area.it is. Editor.
The results of
give
Thisinstructions
project hastojust
theone file, named
what was created in
computer.
main.py. The .py shows that the thefile is
Editor will be
in a Python file format. shown here.
Hello World
The first thing we are going to do is use the print function.

That’s
Talk toright!
a partner:
We want
Can toyoumake
remember
particular
whattext
theshow
printup
function
on the
Next, we
Then, we need
are going
to type
to add
a screen.
To do this, we must start does?
pair
a pairofof
parentheses.
double quotes. If
by typing the world ‘print’
you areifusing
Again, you are
Tynker,
usingthe
into the Editor. The word
second bracket
Tynker, the second
appears
double
should be in all lowercase.
as soonappears
quotes as the first
as soon
is as
typed.
the first is typed.

How sssspectacular!
Hello World
Once you
Inside the have
double
done
quotes,
this, we
youshould
shouldtype
execute
in the
your
words
code.
weThe
would
like to
text ‘Hello
appear
world’
on the
should
screen.
now In
appear
this instance,
on screen.
you should type
‘Hello world’.

This is my code in
Now thisI text
execute
appears
my code
on the
using the Play
Editor. screen. button.

Really good Python coding everyone! But can we go one step


further?
Print Practise
Now, have a go at practising what you have just learnt by
creating Python projects that print the following text:
your favourite colour
an animal of your choice
a country you have visited or want to visit

Excellent coding. Your code may have looked something like


this.
That’s right! I forgot to add the
double quotes around Talk
Oops!
toDid
some a partner:
of you spotCan
the the you
mistake
debug
in my
text I want to show on code
my and tell mecode?
screen. where I went wrong?
Here’s what my code should have
looked like.
What Is Your Name?
Let’s get the Python program asking a question and responding to
an answer.
To do this, we need to get information from the person answering
the question. In Python, to get information from a user, the input
function is used. This information can then be stored as a
variable.
What Is Your Name?
In this Python program, we want the program to ask the user
their name, the user to type their response and the program to
respond.
Then, we need to type in the question we want to ask the user.
First, we need
To doto
this,
create
typethe
your_name
variable. =
The
input
variable
into the
will be called
This should be something similar to “What is your name?” or
your_name.
Editor.
“Who are you?”

Your code should now look like this.


What Is Your Name?
Now it is time to execute your code. Once you have done this, you
will notice that your question appears on the screen with space
for a user to type their name.

Top Tip: You may want to add


a space after you have typed
the program’s response. This
will ensure there is a space
Well done! between
It is now time to code the
the response and the
Hands up: What do youprogram’s
think the code should
response.
user’s We need to use the
name.
look like? print function and include the name of
Did you say something the
similar to this? Have a go at typing this
variable.
code into your Python program. Once you have finished,
execute and test your code.
Python for Beginners
Completed
Well done on some excellent Python coding! Soon you will be a
Python wisssard!

You might also like