Here is a simpler and quicker Sieve generator in Python:
maxPrime = int(input("What are the primes up to this number?"))
sieve = list(range(maxPrime))
for i in range(2, maxPrime):
if sieve[i]: # not removed yet = prime!
print(i)
for product in range(i, maxPrime, i): # gets i*n for all n up to i*n > maxPrime
sieve[product] = 0 # marked as not prime
The problem in your code is that you always assign p2=soe[0]
. Additionally, at the end, you print soe, when you have already removed everything from it.
You should print every new p2 you use, including 2, and end the program when soe is empty.
Here is your modified program that is working, with comments:
n = int(input("What are the primes up to this number?"))
soe = []
for i in range (2, n+1):
soe.append(i)
# you can progress straight into sieving out numbers!
while p2 < n and soe: # stop when your list is empty!
p2 = soe[0]
print(p2)
for i in soe:
if i % p2 == 0:
soe.remove(i)
# print (soe) # it's going to be empty at the end