Tuesday, 17 November 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Capital Letters
strings + upper and lower case
Count the capitals
Write a function called count_capitals
Return how many capital letters are in the text. Small letters, spaces, numbers and marks like ! do not count. In "Hello World" there are 2. The handy trick .isupper() is True for a capital letter, and an empty text has 0.
Examples
| Input | Output |
|---|---|
| "Hello World" | 2 |
| "abc" | 0 |
| "" | 0 |
| "ABC" | 3 |
There are extra hidden tests, so make it work in general, not just for these.
A capital for every word
Write a function called capitalise_words
Return the text with the first letter of every word turned into a capital. The text is made of small letters, numbers and single spaces, and words are separated by one space. So "hello big world" gives "Hello Big World". Numbers stay as they are, and an empty text gives an empty text. The trick .upper() turns a letter into its capital.
Examples
| Input | Output |
|---|---|
| "hello world" | "Hello World" |
| "cat" | "Cat" |
| "" | "" |
| "a b c" | "A B C" |
There are extra hidden tests, so make it work in general, not just for these.
Spot the new words
Write a function called split_camel
Some names mark a new word with a capital letter instead of a space, like "helloBigWorld". Turn that back into plain words: put a space in front of each capital and make it small. So "helloBigWorld" gives "hello big world". The text always starts with a small letter, and a text with no capitals comes back unchanged.
Examples
| Input | Output |
|---|---|
| "helloWorld" | "hello world" |
| "cat" | "cat" |
| "" | "" |
| "aBC" | "a b c" |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.