Oct-28-2020, 01:20 PM
(Oct-27-2020, 04:30 PM)Larz60+ Wrote: You have lists for dictionary values, so must access each element in "grocery" and save back as value.title()
example:
pond_animals = { "fish": ["trout", "sumfish", "perch"], "amphibians": ["frogs", "salamanders", "snakes", "turtles"] } for n, value in enumerate(pond_animals["amphibians"]): pond_animals["amphibians"][n] = value.title() print(pond_animals["amphibians"])
Output:['Frogs', 'Salamanders', 'Snakes', 'Turtles']
Thank you for that! It was exactly what I was looking for!