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
#9
(Oct-27-2019, 01:00 AM)jefsummers Wrote: Seems like a job for recursion.

That was my idea as well. However, if you need to change the list in place, note that you need to assign the capitalized string back to the list itself (specifically the index of the uncapitalized string). So it's a loop that recurses on lists, does item assignment to capitalize strings, and ignores everything else.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Capitalize first letter of names in nested loops - by ichabod801 - Oct-27-2019, 02:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with nested loops robert5502001 7 3,725 Aug-01-2022, 06:26 AM
Last Post: stevensanders
  computing average in nested loops cap510 5 5,266 Sep-11-2020, 12:33 PM
Last Post: deanhystad
  nested for loops to recursion ashkea26 4 3,570 Nov-02-2018, 05:00 PM
Last Post: ichabod801
  Nested loops in openCV JimmyJangle 1 4,882 Apr-17-2018, 04:10 AM
Last Post: Mekire
  capitalize all letters atux_null 5 3,963 Dec-03-2017, 07:07 PM
Last Post: buran
  Nested for loops with numbers Liquid_Ocelot 7 5,996 Aug-15-2017, 06:38 AM
Last Post: nilamo
  Nested loops, lists and if statements Liquid_Ocelot 10 9,148 Apr-23-2017, 02:02 PM
Last Post: Mekire
  Captalizing the letter from the first two names riko 6 6,423 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