Python Forum
Capitalize first letter of names in nested loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Capitalize first letter of names in nested loops
#1
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?
Reply


Messages In This Thread
Capitalize first letter of names in nested loops - by student_of_python - Oct-25-2019, 09:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with nested loops robert5502001 7 3,827 Aug-01-2022, 06:26 AM
Last Post: stevensanders
  computing average in nested loops cap510 5 5,430 Sep-11-2020, 12:33 PM
Last Post: deanhystad
  nested for loops to recursion ashkea26 4 3,630 Nov-02-2018, 05:00 PM
Last Post: ichabod801
  Nested loops in openCV JimmyJangle 1 4,922 Apr-17-2018, 04:10 AM
Last Post: Mekire
  capitalize all letters atux_null 5 4,065 Dec-03-2017, 07:07 PM
Last Post: buran
  Nested for loops with numbers Liquid_Ocelot 7 6,107 Aug-15-2017, 06:38 AM
Last Post: nilamo
  Nested loops, lists and if statements Liquid_Ocelot 10 9,272 Apr-23-2017, 02:02 PM
Last Post: Mekire
  Captalizing the letter from the first two names riko 6 6,575 Mar-10-2017, 10:11 PM
Last Post: riko

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020