input: Write a function to perform a left join on two lists of dictionaries based on the 'id' key.
  assert left_join([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}], [{'id': 1, 'age': 25}]) == [{'id': 1, 'name': 'Alice', 'age': 25}, {'id': 2, 'name': 'Bob', 'age': None}]
  assert left_join([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}, {'id': 3, 'name': 'Charlie'}], [{'id': 2, 'age': 30}, {'id': 3, 'age': 35}]) == [{'id': 1, 'name': 'Alice', 'age': None}, {'id': 2, 'name': 'Bob', 'age': 30}, {'id': 3, 'name': 'Charlie', 'age': 35}]
  assert left_join([{'id': 1, 'name': 'Alice'}], [{'id': 2, 'age': 20}]) == [{'id': 1, 'name': 'Alice', 'age': None}]
output: def left_join(list1, list2):
      dict2 = {d['id']: d for d in list2}
      result = []
      for item in list1:
          joined_item = item.copy()
          if item['id'] in dict2:
              joined_item.update(dict2[item['id']])
          else:
              joined_item['age'] = None
          result.append(joined_item)
      return result