"""Explainable recommendation rules for Project 03.""" def recommend_lesson( experience: str, goal: str, knows_python: bool, completed_topics: list[str], ) -> tuple[str, str]: """Recommend the next lesson and explain the decision.""" experience = experience.strip().lower() goal = goal.strip().lower() completed = {topic.strip().lower() for topic in completed_topics} if experience == "beginner" and "ai foundations" not in completed: return ( "Ai Foundations", "Start with the basic concepts before selecting a specialization.", ) if not knows_python: return ( "Python Foundations", "Basic Python knowledge is recommended before practical Ai projects.", ) if goal == "machine learning": if "data preparation" not in completed: return ( "Data Preparation", "Machine Learning requires clean and well-structured data.", ) return ( "Supervised Learning Basics", "You are ready to begin classification and regression.", ) if goal == "generative ai": return ( "Prompt Engineering", "This introduces structured interaction with Generative Ai models.", ) if goal == "computer vision": return ( "Image Classification Basics", "Image classification is a suitable starting point for Computer Vision.", ) return ( "Ai Applications Overview", "Explore the main Ai application areas before selecting a pathway.", )