DEV Community

Cover image for Day 2: Build Task Mastery ๐Ÿ“
Xion Apex Academy
Xion Apex Academy

Posted on

Day 2: Build Task Mastery ๐Ÿ“

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!")
Enter fullscreen mode Exit fullscreen 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!")
Enter fullscreen mode Exit fullscreen mode

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)
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฎ 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
Enter fullscreen mode Exit fullscreen mode

Step 2: Test Your Loop

๐ŸŽฎ Test It:

  1. Run your code
  2. Add 3-4 different tasks:
    • "Study Python basics"
    • "Build my portfolio"
    • "Practice coding daily"
    • "Apply for internships"
  3. Type "done" to finish
  4. 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)}")
Enter fullscreen mode Exit fullscreen mode

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!")
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฎ 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!
Enter fullscreen mode Exit fullscreen mode

โœ… 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}!")
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฎ Advanced Testing

Try these scenarios to really test your bot:

  1. Empty log test: Start and immediately type "done"
  2. Single task test: Add one task and finish
  3. Heavy load test: Add 8+ tasks and see the motivation change
  4. 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)