input: 
  def detect_errors(function_code: str) -> str:
      """ Given a Python function as a string, detect any potential errors in the function.
      The function should analyze the code and return a descriptive error message if any
      potential issues are found.
      >>> detect_errors("def expand_list(list):\n    for item in list:\n        list *= 2")
      'The function is attempting to modify the list while iterating over it. This can lead to unexpected behavior and should be avoided. To fix the code, the list should be copied before the iteration takes place.'
      """
  
output:     lines = function_code.split('\n')
      for i, line in enumerate(lines):
          if 'for' in line and 'in' in line and 'list' in line:
              if 'list' in lines[i+1] and ('*=' in lines[i+1] or '+=' in lines[i+1]):
                  return 'The function is attempting to modify the list while iterating over it. This can lead to unexpected behavior and should be avoided. To fix the code, the list should be copied before the iteration takes place.'
      return ''