# 输入一个数据,删除一个列表中的所有指定元素
# 给定的列表数据
data = [1,2,3,4,5,6,7,8,9,0,5,4,3,5,"b","a","c","f","d","b","a","c",]
print("打印删除前的列表元素!")
print(data)
# 用户输入
needDeleteElement = input("请输入需要删除的列表元素:")
# 如果用户输入的是数字就进行数据转换
if needDeleteElement.isdigit():
needDeleteElement = int(needDeleteElement)
# while删除列表元素
while needDeleteElement in data:
data.remove(needDeleteElement)
print("打印删除后的列表元素!")
print(data)