Challenge 3: Walrus in a Loop-Free Context — Possible Solution ==================================================================== text = "Hello, Python world!" if (length := len(text)) > 10: print(f"Too long: {length} characters") Output: Too long: 21 characters WHY THIS WORKS AS AN ANSWER ------------------------------ (length := len(text)) does two things in a single expression, exactly this chapter's walrus-operator explanation: it calls len(text) once, ASSIGNS that result to the new variable length, and the if condition then evaluates whether that same assigned value is greater than 10 — all without a separate assignment line written before the if, and without calling len(text) a second time inside the print() call. Without the walrus operator, achieving the same result would require either two lines (length = len(text) on its own line, then a separate if length > 10:), or calling len(text) twice — once inside the condition, once again inside the f-string — exactly the repeated-call inefficiency this chapter's own list-length example was built to avoid. The parentheses around length := len(text) are required syntax — the walrus assignment needs to be wrapped in parentheses when used inline inside an if condition like this, distinguishing it clearly from a plain comparison.