☰ Year plan · Communication Technology

Strings in Python

Week 6 · Unit 1, Lesson 3 Strings and Lists in Python (1) · 3 lessons
Answers are for parents and teachers.
1
What is len("good morning")? Count each character.
2
Draw the index sheet for "garden". Which letter is text[2] and which is text[-2]?
ABCDEF
1garden
2012345
3−6−5−4−3−2−1
3
What does this loop show?
Python
1for letter in "go":
2    print(letter)
4
A friend writes text[0] = "H" to change the first letter of “hello”. What happens and what can be done instead?
5
What do "5" + "2" and 5 + 2 give? Why do they differ?