| 1 | 1 | def proverb(*items: str, qualifier: str | None = None) -> list[str]: |
| 2 | pass | |
| 2 | # Edge Case: Empty input list | |
| 3 | if not items: | |
| 4 | return [] | |
| 5 | ||
| 6 | result = [] | |
| 7 | ||
| 8 | # Generate the main verses using unpacking and multiple assignment | |
| 9 | for current, next_item in zip(items, items[1:]): | |
| 10 | result.append(f"For want of a {current} the {next_item} was lost.") | |
| 11 | ||
| 12 | # Handle the final verse with qualifier | |
| 13 | if qualifier: | |
| 14 | result.append(f"And all for the want of a {qualifier} {items[0]}.") | |
| 15 | else: | |
| 16 | result.append(f"And all for the want of a {items[0]}.") | |
| 17 | ||
| 18 | return result |