input: Write a function to sort a list of objects by one of their attributes. The function should take a list of objects and the name of an attribute as input and return the list of objects sorted by that attribute.
  assert sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")==[{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}]
  assert sort_by_attr([{"name": "Charlie", "age": 30}, {"name": "David", "age": 25}], "name")==[{"name": "Charlie", "age": 30}, {"name": "David", "age": 25}]
  assert sort_by_attr([{"name": "Eve", "age": 35}, {"name": "Fred", "age": 30}], "age")==[{"name": "Fred", "age": 30}, {"name": "Eve", "age": 35}]
  assert sort_by_attr([], "name")==[]
output: return sorted(lst, key=lambda x: x.get(attr))