| 1 | def proverb(): | |
| 2 | pass | |
| 1 | def proverb(*args, qualifier=None): | |
| 2 | if not args: | |
| 3 | return [] | |
| 4 | ||
| 5 | # Edge Case: Single item in list | |
| 6 | if len(args) == 1: | |
| 7 | if qualifier: | |
| 8 | return [f"And all for the want of a {qualifier} {args[0]}."] | |
| 9 | else: | |
| 10 | return [f"And all for the want of a {args[0]}."] | |
| 11 | ||
| 12 | lines = [] | |
| 13 | # Edge Case: Multiple items in list | |
| 14 | for i in range(len(args) - 1): | |
| 15 | lines.append(f"For want of a {args[i]} the {args[i+1]} was lost.") | |
| 16 | ||
| 17 | # Edge Case: qualifier is provided | |
| 18 | if qualifier: | |
| 19 | lines.append(f"And all for the want of a {qualifier} {args[0]}.") | |
| 20 | else: | |
| 21 | lines.append(f"And all for the want of a {args[0]}.") | |
| 22 | ||
| 23 | return lines | |
| 24 | ||
| 25 | # Handled Edge Cases: empty input list, single item in list, multiple items in list, qualifier is provided, qualifier is not provided |