Oct-25-2019, 09:52 AM
Hi guys,
I got this:
names=[['peter','jack','bo'],'eva',['christian','joanne',7],'5']
#Make all names in nested loop above with capital first letters, dont make new list but change current list
#elements 7 and '5' should be left as is
I can't seem to figure out how to extract these names and make it the words capital letters.
I currently am thinking of looping through the names and trying to use names.capitalize()
but can't do that on lists and all the names on the list are not capitalized as the ones in the nested lists are untouched.
Any ideas on what to do with this silly challenge?
I got this:
names=[['peter','jack','bo'],'eva',['christian','joanne',7],'5']
#Make all names in nested loop above with capital first letters, dont make new list but change current list
#elements 7 and '5' should be left as is
I can't seem to figure out how to extract these names and make it the words capital letters.
I currently am thinking of looping through the names and trying to use names.capitalize()
but can't do that on lists and all the names on the list are not capitalized as the ones in the nested lists are untouched.
Any ideas on what to do with this silly challenge?