python列表删除数据问题
ls=int,input().split() n=int(input()) for i in range(n+1): if n in ls: ls.remove(n) print(ls) else: print('NOT FOUND')
报错:期望输出:[1, 3, 4, 5]我的输出:NOT FOUND
收起
ls = list(map(int,input().split())) n = int(input()) if n in ls: while ls.count(n)>0: ls.remove(n) print(ls) else: print('NOT FOUND')
报告相同问题?