I'm a beginner and I wrote a code that the computer takes some numbers as a list and removes compound numbers and keeps prime numbers then prints the list. It doesn't work with numbers greater than 5 and gives
ValueError: list.remove(x): x not in list error.
a=list(map(int,input('Enter some numbers:').split()))
for i in range(0,len(a)):
b=a[i]
for j in range(2,b):
if b%j==0:
a.remove(b)
else:
pass
else:
print('The prime numbers are:',a)