← Back to challenges

Capitalize the Names

PythonHardloopsarraysformatting

Instructions

Create a function that takes a list of names and returns a list where only the first letter of each name is capitalized.

Examples

cap_me(["mavis", "senaida", "letty"]) ➞ ["Mavis", "Senaida", "Letty"]

cap_me(["samuel", "MABELLE", "letitia", "meridith"]) ➞ ["Samuel", "Mabelle", "Letitia", "Meridith"]

cap_me(["Slyvia", "Kristal", "Sharilyn", "Calista"]) ➞ ["Slyvia", "Kristal", "Sharilyn", "Calista"]

Notes

  • Don't change the order of the original list.
  • Notice in the second example above, "MABELLE" is returned as "Mabelle".
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Largest Numbers in a Group of Lists