input: 
  def sort_by_attr(objects, attr):
      """
      Sorts a list of objects based on a specific attribute of the objects.
      
      >>> sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
      [{'name': 'Alice', 'age': 20}, {'name': 'Bob', 'age': 21}]
      """
      return sorted(objects, key=lambda item: item[attr])
  
output:     return sorted(objects, key=lambda item: item[attr])