Exercise 1: Optional String with if let (Swift 5.7 Shorthand) — Possible Solution ======================================================================================== var favoriteColor: String? = nil if let favoriteColor { print("Favorite color: \(favoriteColor)") } else { print("No favorite color yet") } // Prints: No favorite color yet favoriteColor = "Teal" if let favoriteColor { print("Favorite color: \(favoriteColor)") } else { print("No favorite color yet") } // Prints: Favorite color: Teal HOW IT WORKS: favoriteColor is declared as String? (an optional String), initially nil. The shorthand `if let favoriteColor { }` (Swift 5.7, SE-0345) checks whether the optional currently holds a real value - if it does, a new, non-optional constant with the same name is available inside the block, holding that unwrapped value. If the optional is nil, the `else` branch runs instead. Re-running the same if-let block after assigning a real string to favoriteColor demonstrates both real outcomes from the identical code, just with the underlying value having changed between the two checks. ANSWER: Declaring favoriteColor as String? = nil, then using `if let favoriteColor { ... } else { ... }` correctly prints "No favorite color yet" while nil, and "Favorite color: Teal" once assigned - the same optional-binding code branches automatically based on whether a real value is actually present. WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the real Swift 5.7 if-let shorthand correctly unwrapping an optional in both its nil and non-nil states, confirming the same conditional logic handles both real cases without any force-unwrapping.