input: Write a function to remove all occurrences of a specified item from a given list. The function should iterate through the list, check if each element is the specified item, and remove it if it is. Finally, the function should return the modified list.
  
  def removeItem(list, item):
      # loop through the list
      for i in list[:]:
          # check if the element is the item to remove
          if i == item:
              # remove the item
              list.remove(i)
      # return the list
      return list
  
  # Example usage:
  list = [1, 2, 3, 4, 2, 5, 2]
  result = removeItem(list, 2)
  assert result == [1, 3, 4, 5]
  
  list = [3, 5, 2, 2, 2, 7]
  result = removeItem(list, 2)
  assert result == [3, 5, 7]
  
  list = []
  result = removeItem(list, 2)
  assert result == []
  
  list = [2, 2, 2, 2]
  result = removeItem(list, 2)
  assert result == []
output: def removeItem(list, item):
      for i in list[:]:
          if i == item:
              list.remove(i)
      return list