Joining text together

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Joining text together

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What do you get when you join "sun" and "shine" end to end?
A sunshine
B sun shine
2. Which one joins the text "3" and "4" into "34"?
A Joining the text "3" and "4" gives 7
B Joining the text "3" and "4" gives "34"
3. You join "Sam" and "Lee" to make a full name. How do you get "Sam Lee" with a space in the middle?
A Join "Sam", then " ", then "Lee"
B Join "Sam" and "Lee" and the computer adds a space
4. Which statement about joining text is true?
A Joining adds two pieces of text like numbers
B Joining glues two pieces of text end to end
5. What do you get when you join "foot" and "ball"?
A football
B ballfoot

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1"sun" + "shine" A"Ava" + " " + "Nguyen"
2"3" + "4" BJoins the two pieces of text end to end to make "sunshine"
3To join a first and last name with a gap between them, join a space in the middle CThere is no space piece, so the result is "AvaNguyen" with the names squashed together. Join a " " in the middle.
4Joining is not adding: joining the text "10" and "2" glues them together as "102" DJoins the text to make "34", not 7
5"Ava" + "Nguyen" E"10" + "2"
6"sun" + shine FThe word shine is missing its quote marks, so it is not text and cannot be joined. It should be "shine".

Definitions

concatenation

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
print("sun" _ "shine")
2.
first = "Mia" last = "Lee" print(first + " " + ____)
3.
_____("3" + "4")
4.
space = " " print("sun" + _____ + "set")
5.
a = "3" b = "4" print(a + _)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A first ← "Mia"
B last ← "Lee"
C full ← first + " " + last
D show "full"
Question 2
A a ← "3"
B b ← "4"
C joined ← a + b
D show joind
Question 3
A part1 ← sun
B part2 ← "shine"
C word ← part1 + part2
D show word
Question 4
A a ← "ice"
B b ← "cream
C food ← a + b
D show food
Question 5
A first ← "Mia"
B full ← first + "Lee"
C show full

Answer Key

Joining text together
Section A: Quick Questions
Q1
A — sunshine
Q2
B — Joining the text "3" and "4" gives "34"
Q3
A — Join "Sam", then " ", then "Lee"
Q4
B — Joining glues two pieces of text end to end
Q5
A — football
Section B: Match the Pairs
Q1
"sun" + "shine" → Joins the two pieces of text end to end to make "sunshine"
Q2
"3" + "4" → Joins the text to make "34", not 7
Q3
To join a first and last name with a gap between them, join a space in the middle → "Ava" + " " + "Nguyen"
Q4
Joining is not adding: joining the text "10" and "2" glues them together as "102" → "10" + "2"
Q5
"Ava" + "Nguyen" → There is no space piece, so the result is "AvaNguyen" with the names squashed together. Join a " " in the middle.
Q6
"sun" + shine → The word shine is missing its quote marks, so it is not text and cannot be joined. It should be "shine".
Section C: Definitions
Q1
concatenation — Gluing two pieces of text end to end into one, so "sun" and "shine" make "sunshine". It joins text together; it does not add numbers, so "3" and "4" make "34".
Section D: Fill in the Blanks
Q1
print("sun" + "shine")
Q2
first = "Mia" last = "Lee" print(first + " " + last)
Q3
print("3" + "4")
Q4
space = " " print("sun" + space + "set")
Q5
a = "3" b = "4" print(a + b)
Section E: Spot the Error
Q1
D — Quote marks turn full into plain text, so the program would show the word full. Without quotes, it shows what is stored in the variable: show full.
Q2
D — The variable is spelled wrong. The program made joined, which holds "34", but this line asks for joind, which does not exist. It should be show joined.
Q3
A — Text must be inside quote marks. Without them, sun looks like a variable name. It should be part1 ← "sun".
Q4
B — The closing quote mark is missing, so the computer cannot tell where the text ends. It should be b ← "cream".
Q5
B — There is no space between the names, so it would show MiaLee. Join a space too: first + " " + "Lee".