input: Write a function to sort a list of dictionaries by a key in each dictionary. If the given list or key is invalid, return False.
  def sort_list_of_dicts_by_key(my_list, key):
      if not isinstance(my_list, list) or not isinstance(key, str):
          return False
      return sorted(my_list, key=lambda k: k.get(key, 0))
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'age')==[{'name': 'John', 'age': 21}, {'name': 'Tom', 'age': 25}, {'name': 'Adam', 'age': 26}]
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'name')==[{'name': 'Adam', 'age': 26}, {'name': 'John', 'age': 21}, {'name': 'Tom', 'age': 25}]
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'height')==[{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}]
  assert sort_list_of_dicts_by_key([], 'name')==[]
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 123)==False
output: def sort_list_of_dicts_by_key(my_list, key):
      if not isinstance(my_list, list) or not isinstance(key, str):
          return False
      return sorted(my_list, key=lambda k: k.get(key, 0))