input: Write a function to create a dictionary from two given lists. The function should take two lists as input and return a dictionary where the elements from the first list are the keys and the elements from the second list are the values. If the lists are of different lengths, the function should return an empty dictionary.
  
  def create_dict_from_lists(list1, list2):
      if len(list1) != len(list2):
          return {}
      return dict(zip(list1, list2))
  
  assert create_dict_from_lists(['a', 'b', 'c'], [1, 2, 3])=={'a': 1, 'b': 2, 'c': 3}
  assert create_dict_from_lists(['x', 'y'], [7, 8, 9])=={}
  assert create_dict_from_lists([], [])=={}
  assert create_dict_from_lists(['p', 'q'], [100])=={}
output: def create_dict_from_lists(list1, list2):
      if len(list1) != len(list2):
          return {}
      return dict(zip(list1, list2))