I'm a novice, so please forgive the basic question.
I'm trying to change the first letter in each word in an array to uppercase (readline is being used for the input phrases, the first of which is 'hello world').
The problem is, my output is 'Hello world' instead of 'Hello World') Can anyone tell me where I'm going wrong and how I can fix it?
Your current code does this:
print uppercase(string[0]) + string[1 to end]Think through the steps logically, how your program does it.
You have a string and not an array. And you need to work on each word that's part of the string separately.
For example:
Or:
It's not just about understanding the language. It's also how to understand the problem.