See the pinned topic for how to format code, and better use for prime in primes: instead of indices.
for prime in primes: