Welcome back, Recruits! Yesterday you gave QuestBot a voice - today we're giving it a brain! ๐ง Day 1 Solution has been posted on Github so you can check it out as a guide.
Alex is back with us, and he's pumped. "My bot actually talked to me yesterday," he said with a grin. "Now I want it to help me stay organized!"
Perfect timing, Alex. Today we're teaching QuestBot to be your personal task manager.
What we're building: A smart task collection system that remembers everything you tell it and displays your missions with style.
Time needed: ~45 minutes
XP Reward: 100 XP + Task Master badge ๐๏ธ
๐ฏ Mission Overview
By the end of today, your QuestBot will:
- ๐ Store and remember multiple tasks
- ๐ Accept unlimited task entries in a loop
- ๐ฏ Display your mission log like a pro
- ๐ช Give motivational feedback based on your workload
๐ Download Day 2 Files
Grab today's templates:
- questbot_day2_template.py - Starter template with TODO hints
- questbot_day2_solution.py - Complete working code
- Your Day 1 code - We'll build on top of yesterday's work!
Choose your path:
- ๐ Tutorial + Template โ Best for learning step-by-step
- ๐ Template Only โ Perfect if you want to practice independently
- โ Need Help? โ Check the solution file if you get stuck
Quest 1: Create the Task Codex (30 XP - 10 min)
Time to give QuestBot some memory! We're going to build a storage system for all your missions.
Step 1: Build on Yesterday's Foundation
Start with your Day 1 code (or use the template):
# QuestBot Day 2 - Task Management Powers
print("๐ค SYSTEM INITIALIZING...")
print("โจ QuestBot v2.0 ONLINE - Now with Task Management!")
print("")
# Day 1 greeting system
name = input("What's your Recruit name? ")
vibe = input("Pick a vibe (epic, chill, heroic): ")
print(f"\\nSalute, {name}! QuestBot is ready in {vibe} mode!")
Step 2: Create Your Task Storage
Here's where the magic happens - we're giving QuestBot memory:
# Create empty list to store tasks
tasks = []
print("\\n๐ Mission Log System ACTIVATED!")
Step 3: Collect Your First Mission
Let's start simple - one task at a time:
# Get a single task from user
task = input("\\nLog a mission (e.g., Study AI): ")
tasks.append(task) # Add task to our list
# Show what we captured
print("\\n๐ Current Mission Log:")
print(tasks)
๐ฎ Test It:
- Run your code
- Enter a task like "Learn Python"
- See it appear in your mission log!
โ Checkpoint: QuestBot can remember one task
Quest 2: Loop the Quest Cycle (40 XP - 20 min)
One task is good, but real productivity needs more! Let's teach QuestBot to collect unlimited missions.
Step 1: Replace Single Input with Loop Power
Replace your single task code with this loop system:
print("\\n๐ Ready to log your missions! Type 'done' when finished.")
print("-" * 50)
while True: # Loop forever until user says stop
task = input("Log a mission (or 'done' to finish): ")
if task.lower() == "done": # User wants to stop
break # Exit the loop
tasks.append(task) # Add task to list
print(f"โ
Added: {task}") # Confirm it was added
Step 2: Test Your Loop
๐ฎ Test It:
- Run your code
- Add 3-4 different tasks:
- "Study Python basics"
- "Build my portfolio"
- "Practice coding daily"
- "Apply for internships"
- Type "done" to finish
- Watch QuestBot collect everything!
โ Checkpoint: QuestBot can collect unlimited tasks and knows when to stop
Quest 3: Display with Epic Flair (30 XP - 15 min)
Raw lists look boring. Let's make your mission log look professional and motivating!
Step 1: Create a Styled Mission Report
Add this after your loop ends:
# Display the epic mission log
print(f"\\n๐ฏ {name}'s Epic Mission Log:")
print("=" * 40)
# Number each task professionally
for i, task in enumerate(tasks, 1): # Start counting from 1
print(f"Mission {i}: {task}")
print("=" * 40)
print(f"๐ Total Missions Logged: {len(tasks)}")
Step 2: Complete Day 2 Code
Here's your full working code for today:
# QuestBot Day 2 - Task Management Powers
print("๐ค SYSTEM INITIALIZING...")
print("โจ QuestBot v2.0 ONLINE - Now with Task Management!")
print("")
# Day 1 greeting system
name = input("What's your Recruit name? ")
vibe = input("Pick a vibe (epic, chill, heroic): ")
print(f"\\nSalute, {name}! QuestBot is ready in {vibe} mode!")
# Task storage system
tasks = []
print("\\n๐ Mission Log System ACTIVATED!")
# Collect multiple tasks
print("\\n๐ Ready to log your missions! Type 'done' when finished.")
print("-" * 50)
while True:
task = input("Log a mission (or 'done' to finish): ")
if task.lower() == "done":
break
tasks.append(task)
print(f"โ
Added: {task}")
# Display epic mission log
print(f"\\n๐ฏ {name}'s Epic Mission Log:")
print("=" * 40)
for i, task in enumerate(tasks, 1):
print(f"Mission {i}: {task}")
print("=" * 40)
print(f"๐ Total Missions Logged: {len(tasks)}")
print("\\n๐ Ready to conquer your missions? Let's go!")
๐ฎ Test Your Complete Bot:
Try this conversation flow:
What's your Recruit name? Alex
Pick a vibe (epic, chill, heroic): epic
Log a mission (or 'done' to finish): Learn Python basics
โ
Added: Learn Python basics
Log a mission (or 'done' to finish): Build my portfolio
โ
Added: Build my portfolio
Log a mission (or 'done' to finish): done
๐ฏ Alex's Epic Mission Log:
========================================
Mission 1: Learn Python basics
Mission 2: Build my portfolio
========================================
๐ Total Missions Logged: 2
๐ Ready to conquer your missions? Let's go!
โ Checkpoint: QuestBot displays tasks professionally with style
๐ Bonus Challenge: Motivational Intelligence (10 XP)
Want to earn extra XP? Make QuestBot give personalized motivation based on workload:
# Add this right after displaying the mission log
print("\\n๐ญ QuestBot's Assessment:")
if len(tasks) == 0:
print(f"๐ค No missions logged yet, {name}. Ready to add some goals?")
elif len(tasks) == 1:
print(f"๐ฏ {name}, laser focus! One mission, maximum impact!")
elif len(tasks) <= 3:
print(f"๐ช Perfect balance! {len(tasks)} missions ready to conquer!")
elif len(tasks) <= 5:
print(f"๐ฅ Ambitious agenda! {len(tasks)} missions show serious dedication!")
else:
print(f"๐ Wow! {len(tasks)} missions? You're unstoppable, {name}!")
๐ฎ Advanced Testing
Try these scenarios to really test your bot:
- Empty log test: Start and immediately type "done"
- Single task test: Add one task and finish
- Heavy load test: Add 8+ tasks and see the motivation change
- Case sensitivity: Try "Done", "DONE", "done" - they should all work
๐ธ Quest Log: Share Your Victory!
Got your Task Master system working? Awesome! Share a screenshot of your mission log on social media with #4IRQuestSaga - I want to see what missions you're planning!
๐๏ธ Badge Unlocked: Task Master
"Mastered the art of digital task management and loop control"
๐ง What You Learned Today
Technical Skills:
- Lists: Storing multiple pieces of data
- Loops: Repeating actions until a condition is met
-
Conditionals: Making decisions in code (
if
/break
) -
String methods: Using
.lower()
for user input - Enumerate: Numbering items in a list automatically
Real-World Applications:
- Task management systems
- User input validation
- Data collection workflows
- Professional output formatting
What's Next?
Tomorrow in Day 3, Alex will add the final touch - AI-powered motivational quotes! We'll teach QuestBot to:
- ๐ฒ Generate random motivational messages
- ๐ง Give contextual advice based on your tasks
- โก Delete completed missions from your log
- ๐ Celebrate your achievements
Your homework: Play with your task system! Try different scenarios, break it on purpose (then fix it), and see what happens with different inputs.
Total XP Earned Today: 100 XP
Running Total: 200/300 XP
Progress: 67% complete ๐
Alex is now 2/3 of the way to his first AI assistant! Tomorrow we add the intelligence. ๐ง
See you for the final day! ๐
Stuck on something? Drop a comment below - the community is here to help! ๐ฅ
Top comments (0)