Given a function, capitalize, which includes str as a parameter, return that str with each word capitalized. Try to think of peak cases in your solution (not as input, wrong type of input, etc.).
- Take a look again at the prompt. Write down or highlight any keywords you can find in the wording.
- Combine the meaning of the word problem. Part of the hardest part of doing code challenges is trying to figure out what the problem is asking you to do. Understanding the problem will help you go a long way in solving it.
- a possible pseudocode solution. It doesn’t have to be the actual code (it doesn’t need to be executable in your IDE or console browser - simple English is fine):
Solve the problem carefully step by step. It will help you think of tip cases - cases where an incorrect entry or an empty string may be passed - and how to break the problem down into logical steps. This is basically your experimentation phase - there are no wrong answers, just thoughts of how to approach the problem. These thoughts can be misleading or misguided - this is how you learn about won approaches to solving a problem