"How do I sort a list with ""Nones last""","groups = sorted(groups, key=lambda a: (a['name'] is None, a['name']))"