By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Grade 6 Computer Science (ICT) Study Guide: Python – Lists, Strings, Basic Operations
"If you’re building a game where players collect items—like coins, keys, or power-ups—how do you store all those items in Python so the game remembers them, changes them, and checks what’s inside? And why can’t you just use a single variable for each one, like coin1 = 5, coin2 = 3, and so on forever?"
coin1 = 5
coin2 = 3
Imagine you’re running a school supply closet where you keep track of all the markers for art class. Instead of labeling each marker with a separate sticky note (marker1 = "red", marker2 = "blue"), you use a single box with dividers inside. That box is a list in Python—a container that holds many items in order, like markers = ["red", "blue", "green", "black"]. You can grab the first marker (markers[0]), add a new one (markers.append("purple")), or even swap two markers (markers[1] = "yellow").
marker1 = "red"
marker2 = "blue"
markers = ["red", "blue", "green", "black"]
markers[0]
markers.append("purple")
markers[1] = "yellow"
But what if you want to work with words or sentences instead of items? That’s where strings come in. A string is like a stretchy rubber band with letters written on it—you can pull out a single letter ("hello"[1] gives "e"), slice a chunk ("hello"[1:4] gives "ell"), or glue two strings together ("hello" + " world"). Lists and strings both use indexing (counting positions starting at 0), but lists can hold any type of data (numbers, words, even other lists!), while strings only hold text.
"hello"[1]
"e"
"hello"[1:4]
"ell"
"hello" + " world"
Key Vocabulary:- List: A container that holds multiple items in order, like a numbered shopping list. Example: inventory = ["sword", 100, True] (holds a string, a number, and a boolean). Note: In Python, lists are mutable—you can change them after creating them (unlike strings, which are immutable).
inventory = ["sword", 100, True]
String: A sequence of characters (letters, numbers, symbols) treated as text. Example: player_name = "Alex_123" (can include letters, numbers, and underscores). Note: In high school, you’ll learn about string encoding (how computers store text as numbers) and regular expressions (tools to search and manipulate text patterns).
player_name = "Alex_123"
Index: The position of an item in a list or string, starting at 0. Example: In fruits = ["apple", "banana", "cherry"], "banana" is at index 1. Note: College courses often use zero-based indexing in algorithms, so Python’s choice isn’t arbitrary!
fruits = ["apple", "banana", "cherry"]
"banana"
1
Concatenation: Combining two strings or lists into one. Example: "cat" + "dog" becomes "catdog"; [1, 2] + [3] becomes [1, 2, 3]. Note: In data science, concatenation is used to merge datasets (e.g., combining two CSV files).
"cat" + "dog"
"catdog"
[1, 2] + [3]
[1, 2, 3]
How This Appears on State/ICT Assessments (Grade 6):- Multiple Choice: Tests understanding of indexing, list operations, or string methods. Example: What does my_list[2] return if my_list = ["a", "b", "c", "d"]? Distractors: "a" (confuses index 0), "d" (counts from the end), "b" (off-by-one error).
my_list[2]
my_list = ["a", "b", "c", "d"]
"a"
"d"
"b"
Short Constructed Response: Write code to modify a list or string, or explain output. Example: Given colors = ["red", "green", "blue"], write a line of code to change "green" to "yellow". What is the new list?
colors = ["red", "green", "blue"]
"green"
"yellow"
Debugging: Identify and fix errors in code. Example: The code word = "python" print(word[6]) crashes. Why? Fix it.
word = "python"
print(word[6])
Proficient vs. Developing Responses:| Proficient | Developing | |----------------|----------------| | Prompt: What does len("hello") return? Explain. | | | Returns 5 because "hello" has 5 characters. The len() function counts the number of items in a string or list. | Returns 4 because they counted letters but forgot the first one (off-by-one error). | | Prompt: Write code to add "purple" to the end of colors = ["red", "blue"]. | | | colors.append("purple") or colors = colors + ["purple"] | colors = "purple" (replaces the list) or colors[2] = "purple" (assumes index 2 exists). |
len("hello")
5
"hello"
len()
4
"purple"
colors = ["red", "blue"]
colors.append("purple")
colors = colors + ["purple"]
colors = "purple"
colors[2] = "purple"
Model Proficient Response (Short Constructed Response):Prompt: Given pets = ["dog", "cat", "fish"], write code to: 1. Remove "cat" from the list.2. Add "hamster" to the end.3. Print the first item in the list.
pets = ["dog", "cat", "fish"]
"cat"
"hamster"
Student Response:
pets.remove("cat") pets.append("hamster") print(pets[0]) # Output: dog
Mistake 1: Off-by-One Indexing Errors- Prompt: What does letters = ["a", "b", "c"] print(letters[3]) output? - Common Wrong Answer: "c" (student counts from 1 instead of 0).- Why It Loses Credit: The list has indices 0, 1, 2. Index 3 is out of range, causing an error.- Correct Approach: - Remember: Indexing starts at 0. - Use len(letters) to check the last index (len(letters) - 1). - Correct output: IndexError (the code crashes).
letters = ["a", "b", "c"]
print(letters[3])
"c"
len(letters)
len(letters) - 1
IndexError
Mistake 2: Confusing Lists and Strings- Prompt: What does "123" + 456 output? - Common Wrong Answer: "579" (student assumes strings and numbers can be added like numbers).- Why It Loses Credit: Python can’t concatenate strings and integers directly.- Correct Approach: - Convert the number to a string first: "123" + str(456) → "123456". - Or convert the string to an integer: int("123") + 456 → 579.
"123" + 456
"579"
"123" + str(456)
"123456"
int("123") + 456
579
Mistake 3: Misusing List Methods- Prompt: Write code to remove "apple" from fruits = ["banana", "apple", "cherry"].- Common Wrong Answer: fruits.delete("apple") or fruits.remove("apple", 1).- Why It Loses Credit: delete isn’t a Python method; remove() only takes one argument.- Correct Approach: - Use fruits.remove("apple") (removes the first occurrence). - Or use del fruits[1] (removes by index).
"apple"
fruits = ["banana", "apple", "cherry"]
fruits.delete("apple")
fruits.remove("apple", 1)
delete
remove()
fruits.remove("apple")
del fruits[1]
Lists store data, but loops process that data. For example, a for loop can print every item in a list (for item in my_list: print(item)), making lists useful for repetitive tasks.
for
for item in my_list: print(item)
Across Subjects: Strings → DNA Sequences (Science)
DNA is a "string" of nucleotides (A, T, C, G). Scientists use string operations (like slicing or searching for patterns) to analyze genetic code—just like you’d search for a word in a sentence.
Outside School: Lists → Playlist Algorithms (Spotify/YouTube)
my_list.append("new_song")
"If strings are immutable (can’t be changed), how does word = "hello" word = word + "!" work? Doesn’t that change the string?"
word = "hello"
word = word + "!"
Pointer Toward the Answer:- When you write word = word + "!", Python doesn’t modify the original "hello" string. Instead, it creates a brand-new string "hello!" and reassigns the variable word to point to it. The old "hello" string still exists in memory (until Python’s garbage collector removes it).- This is why strings are called "immutable"—you can’t change them in place, but you can create new strings based on them. Lists, on the other hand, are mutable: my_list.append("new") changes the list directly.- Bonus: In college, you’ll learn about memory management and why immutability matters for security (e.g., preventing accidental changes to sensitive data).
"hello!"
word
my_list.append("new")
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.