Advanced Python Coding Mission Worksheet
Use this sheet to capture notes and plan your RPG.
1) Warm-Up Check-In
- Something I remember from the Python Intro workshop:
- The first room of my RPG will be:
2) Lists Quick Reference
A list holds multiple items in order:
inventory = [] # empty list
inventory.append("key") # add an item
print(inventory[0]) # get the first item
Write code to add "torch" to an empty list called bag and print the first item:
# Write your code here:
3) Dictionary Quick Reference
A dictionary holds labeled data:
room = {
"name": "Dark Cave",
"exits": ["entrance", "tunnel"],
"item": "torch"
}
print(room["name"]) # Dark Cave
What does room["exits"][1] print?
4) Function Anatomy
Label the parts of this function:
def describe_room(room):
print(f"=== {room['name']} ===")
print(room['description'])
describe_roomis theroominside the( )is the- The indented lines are the function
5) Room Planner
Sketch out the rooms in your RPG. Draw a box for each room and arrows for exits. Include at least 3 rooms.
| Room Name | Description (one sentence) | Item (or none) |
|---|---|---|
6) Class Anatomy
Fill in what each line does:
class Player:
def __init__(self, name):
self.name = name # ____________________________
self.health = 100 # ____________________________
self.inventory = [] # ____________________________
When you write player = Player("Alex"), which method runs?
7) Reflection
- The concept that made the most sense today:
- Something I want to add to my RPG after the workshop:
- A question I still have: