input: 
  def expand_list(list):
      """ Analyzes and modifies a list by iterating over it and duplicating its elements.
      However, iterating over the list while modifying it can lead to unexpected behavior. 
      This function should be rewritten to avoid this issue.
      >>> expand_list([1, 2, 3])
      [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
      """
  
output:     new_list = []
      for item in list:
          new_list.extend([item] * 6)
      return new_list