All challenges

Tuesday, 17 November 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Capital Letters

strings + upper and lower case

Rung 1Daily goal5 points

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

InputOutput
"Hello World"2
"abc"0
""0
"ABC"3

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

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

InputOutput
"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.

Rung 3Bonus10 points

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

InputOutput
"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.