0% found this document useful (0 votes)
12 views20 pages

Strings 1

Powerpoint to accompany the 1st lesson on Strings in Python for KS3 students.

Uploaded by

Aakifah Rahman
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)
12 views20 pages

Strings 1

Powerpoint to accompany the 1st lesson on Strings in Python for KS3 students.

Uploaded by

Aakifah Rahman
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/ 20

r l d” “Al Arqam”

Wo
e ll o
H

STRINGS 1

“I am a String”
STARTER

2. Give an 1. What is a
example of String?
a String

3. How are
Strings different
from Integers?
OBJECTIVES

•Work on Strings in Python by


printing strings and concatenating
strings together
SUCCESS CRITERIA

YOU YOU YOU


MUST SHOULD COULD

Print strings Concatenate Complete Task


strings 5 including the
together challenge
question
Why are we learning to print text?

We play a lot of games, use apps and


use electrical equipment that send out
messages to us.

These are all programmed by someone.


Examples of text used in our every day lives
Can you think of any more?
CLASS TASK
1 MIN

In Python type in:

print(“Danger Will Robinson!”)

What happened? Did you get errors?


Check with the friend next to you. Discuss any errors.
Now print the same text but enclose it in single
quotes
• Any text enclosed in quotes is called a
String in Python

• Examples:
What is a var1 = “Hello”
String in var2 = “35”
Python var3 = ‘I love my school’
var4 = ‘FIFA 2022’

• Strings can use either single quotes or


double quotes in Python.
Using quotes with strings

Remember!
If the string begins with
a single quote (‘) it must
end with a single
If the string begins with
a double quote (“) it
must end with a double
Time to think
• What does this code print?

OUTPUT

• It prints the 2 variables in 2 separate lines, since this is how print


works.
TASK 3
3 MINS

• Print your name

• Print the name of your


favourite color

• Now think how can you print


both on the same line ??
Concatenation of strings

• Joining of two or more strings together is called Concatenation.

• The + operator does this in Python for strings.

‘My’ + ‘Python’ = ‘My Python’


CLASS TASK – Concatenation of strings

OUTPUT

Both strings are


stored in variables
and then
concatenated
CLASS TASK – Concatenation of strings

OUTPUT

Here 1 string is stored


in a variable and one is
not, and then they are
both concatenated
together
Write a Python program to store
3 strings in 3 variables, and then

TASK print them out in 1 line.

4A Example – ‘I’, ‘love’, ‘Qatar’


becomes ‘I love Qatar’
TASK 4A
Write a Python program to store
3 strings in 3 variables, and then
str1 = ‘I’ print them out in 1 line.
str2 = ‘love’
str3 = ‘Qatar’
print(str1 + str2 + str3) Example – ‘I’, ‘love’, ‘Qatar’
becomes ‘I love Qatar’
Write a Python program to
add 'ing' at the end of a string

TASK stored in a variable.

4B Example – ‘help’ becomes


‘helping’
TASK 4B Write a Python program to
add 'ing' at the end of a string
str1 = ‘help’ stored in a variable.
print(str1 + ‘ing’)

Example – ‘help’ becomes


‘helping’
Print out a door using Python with some text that says
TASK 5 – choose the door you would like to enter.

PAIRED TASK Challenge - Printing 2 doors next to each other would be


even better!
PLENARY
• Fill in the Feedback Wall with a one-word hashtag on how you find ICT
lessons !

“ What’s
exciting?
FEEDBACK WALL “ Tell the
class your


thoughts

#co
ol ”
ting
e s
#i nter

You might also like