← Back to challenges

Secret Society

PythonHardstringsarrays

Instructions

A group of friends have decided to start a secret society. The name will be the first letter of each of their names, sorted in alphabetical order.

Create a function that takes in a list of names and returns the name of the secret society.

Examples

society_name(["Adam", "Sarah", "Malcolm"]) ➞ "AMS"

society_name(["Harry", "Newt", "Luna", "Cho"]) ➞ "CHLN"

society_name(["Phoebe", "Chandler", "Rachel", "Ross", "Monica", "Joey"]) ➞ "CJMPRR"

Notes

The secret society's name should be entirely uppercased.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is the Word an Isogram?