I want to sort the list of friends returned by Facebook's Graph API. The result after sorting needs to be an alphabetical order of friends by name.
[
{
"name": "Joe Smith",
"id": "6500000"
},
{
"name": "Andrew Smith",
"id": "82000"
},
{
"name": "Dora Smith",
"id": "97000000"
},
{
"name": "Jacki Smith",
"id": "107000"
}
]
Additional notes: I am running on Google App Engine, which uses Python 2.5.x.
sorted(flist, key=lambda friend: friend["name"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With