Question: Write a recursive function that takes an array of words and returns an array that contains all the words capitalized. If this is the input

Write a recursive function that takes an array of words and returns an array that contains all the words capitalized.
If this is the input array:
['foo', 'bar', 'world', 'hello']
The output array should be:
['FOO', 'BAR', 'WORLD', 'HeLlo']
Here is a hint: Run the following snippet of code. [0] is first position as we've done before. The [1:] returns the rest of the list. Now what
happens if you use that as a recursive argument passed back into a function? 'red', 'blue', 'green', 'black'. What is now [0]? etc etc.
arr[0].upper() is ok to use in this case.
Write a recursive function that takes an array of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!