Python Data Structures Practice

Educational Python repository for WGU's Master of Science in Software Engineering - AI Engineering program. Interactive Jupyter notebooks teaching data structures with ADHD-friendly exercises.

View the Project on GitHub chevyphillip/python-data-structures-practice

Quick Study Guide - Data Structures Mastery

🎯 Learning Path (10 hours/week)

Week 1: Foundation Building

Week 2: Integration & Application


🧠 Memory Aids for ADHD Learning

Lists - “The Ordered Collection”

# Think: "Items in sequence, duplicates OK"
playlist = ["song1", "song2", "song1"]  # Order matters, duplicates allowed

Dictionaries - “The Lookup Table”

# Think: "Key opens the door to value"
student_grades = {"Alice": 95, "Bob": 87}  # Key → Value mapping

Sets - “The Unique Club”

# Think: "No duplicates allowed, no order"
unique_emails = {"alice@email.com", "bob@email.com"}  # Unique only

⚡ Quick Reference

Lists Operations

my_list = [1, 2, 3, 4, 5]
my_list[0]        # First: 1
my_list[-1]       # Last: 5  
my_list[1:3]      # Slice: [2, 3]
my_list[::2]      # Every 2nd: [1, 3, 5]
my_list.append(6) # Add to end

Dictionary Operations

my_dict = {"a": 1, "b": 2}
my_dict["a"]              # Get value: 1
my_dict["c"] = 3          # Add/update
my_dict.get("d", 0)       # Safe get: 0
my_dict.keys()            # All keys
my_dict.values()          # All values

Set Operations

set1 = {1, 2, 3}
set2 = {3, 4, 5}
set1 & set2              # Intersection: {3}
set1 | set2              # Union: {1, 2, 3, 4, 5}  
set1 - set2              # Difference: {1, 2}

🚨 Common Mistakes to Avoid

  1. Lists: Forgetting lists are mutable
    # Wrong approach
    original = [1, 2, 3]
    modified = original
    modified.append(4)  # Changes original too!
       
    # Correct approach  
    modified = original.copy()  # or original[:]
    
  2. Dictionaries: KeyError when key doesn’t exist
    # Risky
    grade = student_grades["Unknown"]  # KeyError!
       
    # Safe
    grade = student_grades.get("Unknown", 0)
    
  3. Sets: Expecting order
    # Sets don't maintain order
    my_set = {3, 1, 2}
    print(my_set)  # Could print {1, 2, 3} or {2, 1, 3}
    

🎓 WGU MSSWEAIE Connections

Data Structures & Algorithms Course

AI/ML Applications

Software Engineering