Array: [2,4,6,7,8,10]
编写一个函数，从数组中删除所有奇数。
def delete_odd_nums(arr): 
  for i in range(len(arr)): 
    if arr[i] % 2 != 0: 
      arr.remove(arr[i]) 
  return arr 

# 测试代码
arr = [2,4,6,7,8,10] 
print(delete_odd_nums(arr))