# LIST AND EVERY ELEMENT IS A DICTIONARY
people = [
    {"name": "<NAME>", "Age": "24"},
    {"name": "<NAME>", "Age": "22"},
    {"name": "<NAME>", "Age": "22"},
    {"name": "<NAME>", "Age": "50"}
]

#teaching function sort how to sort ☝

def f(person):
    return person["name"]

#PASSING key as f()
people.sort(key=f)

print(people)

# LIST AND EVERY ELEMENT IS A DICTIONARY
people = [
    {"name": "<NAME>", "Age": "24"},
    {"name": "<NAME>", "Age": "22"},
    {"name": "<NAME>", "Age": "22"},
    {"name": "<NAME>", "Age": "50"}
]

#teaching function sort how to sort ☝

def f(person):
    return person["name"]

#PASSING key as f()
people.sort(key=f)

print(people)

# LIST AND EVERY ELEMENT IS A DICTIONARY #teaching function sort how to sort ☝ #PASSING key as f()