Python Homework: List, Tuple, Set, Dictionary
Name: ______________________ Date: ______________________
PART 1: Match the Items
Match the correct data type to its description.
1. A basket that doesn't allow repeats. ________
2. A collection you can't change. ________
3. Has keys and values like a mini glossary.________
4. You can add, remove, and keep order. ________
PART 2: Fill in the Blanks
1. A list uses __________ brackets.
2. A set cannot have __________ items.
3. A dictionary uses __________ pairs.
4. A tuple is __________ (changeable / unchangeable).
PART 3: Write the Code
Q1. Make a list of your 3 favorite fruits and print them.
# Your code here:
Q2. Make a tuple with 3 shapes: 'circle', 'square', 'triangle'
# Your code here:
Q3. Create a set of numbers: 1, 2, 2, 3, 4, 4 and print it.
Page 1
Python Homework: List, Tuple, Set, Dictionary
# Your code here:
Q4. Create a dictionary of a student with name, age, and grade.
# Your code here:
PART 4: Answer These Questions
1. What happens when you try to add a duplicate to a set?
Answer: ____________________________
2. Can you change a value inside a tuple?
Answer: ____________________________
3. How do you get a value from a dictionary?
Answer: ____________________________
4. Which one is best to use if you want to match a 'word' to its 'meaning'?
Answer: ____________________________
Page 2