class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
val_appearance_count = nums.count(val)
for _ in range(val_appearance_count):
nums.remove(val)
return len(nums)