lesson

Capitalize every word

objective: debugging exercise · functions & strings · medium
Task type: fix broken code

capitalize_each(words) should return a new list with every word capitalized. Right now it only processes the first word.

fix this code so it matches

capitalize_each(['hi', 'there']) is ['Hi', 'There']. capitalize_each(['ok']) is ['Ok']. capitalize_each([]) is [].

  • Passes the visible tests
  • Passes the hidden tests (edge cases)
Go deeper

Lesson resources

Finding resources…
capitalize_each.pyattempt 0
1
2
3
4
5
6