Exercise 4: A Fresh Character-Type Accumulator — Possible Solution ==================================================================== text = "Order #4521 shipped on 03/15 - contact support@example.com!" letters = 0 numbers = 0 spaces = 0 special = 0 for ch in text: if ch.isalpha(): letters += 1 elif ch.isnumeric(): numbers += 1 elif ch.isspace(): spaces += 1 else: special += 1 print(f"Letters: {letters}") print(f"Numbers: {numbers}") print(f"Spaces: {spaces}") print(f"Special: {special}") Output: Letters: 38 Numbers: 8 Spaces: 7 Special: 6 WHY THIS WORKS AS AN ANSWER ------------------------------ Nothing about the loop itself changes from the lesson's own example — the same four-way if/elif/elif/else chain handles this messier string exactly as well as it handled the tidy one, because every single character in the string still falls into exactly one of the four buckets, no matter how many different symbol types show up. The "special" bucket ends up doing real work here: #, /, -, @, ., and ! all land there, none of them caught by isalpha(), isnumeric(), or isspace() — which is the whole reason the else branch exists rather than a dedicated .isspecial() check.