# Week 9 – Blockfuse Labs Python Learning Journal Instructor: Mr. Bankat This Week’s Topics In Week 9, we explored Conditionals, the match–case statement, and also touched on Dictionaries. These concepts are crucial for decision-making in Python and for organizing data in a structured way. 1. Conditionals in Python Conditionals allow our programs to make decisions based on certain conditions. Basic Syntax ```python if 5 > 4: print(True) elif 5 >= 5: print(True) else: print(False) ``` Key Notes: if checks the first condition. elif (else if) checks other possibilities. else is the fallback if no condition is met. 2. The match–case Statement Match–case is similar to switch statements in other languages. It’s used for cleaner multi-condition checks. ```python day = "Monday" match day: case "Monday": print("Start of the work week.") case "Friday": print("Last day of the work week.") case _: print("Just another day.") ``` 3. Putting It All Together ```python students = { "Mark": 85, "Jane": 70, "John": 50 } name = input("Enter student name: ") if name in students: score = students[name] match score: case s if s >= 70: print(f"{name} passed with distinction.") case s if s >= 50: print(f"{name} passed.") case _: print(f"{name} failed.") else: print("Student not found.") ``` Conclusion In Week 9, we learned how to: Use if–elif–else to make decisions. Use match–case for cleaner branching. Work with dictionaries for structured data. These tools will be essential in building more interactive and intelligent Python programs as we move forward.