#primenumbers.py
This program will generate all prime numbers upto the given number, num. To increase the efficiency of the operation, it only checks odd numbers for whether they are prime(since, 2 is the only even prime number).num= #insert a number here e.g num=1000pp=2
ps=[pp] #here, pp is stored into the list, ps.
pp+=1
ps.append(pp)
while pp<int(num):
pp+=2
test=True
for a in ps:
if pp%a==0: test=False
if test: ps.append(pp)
print (ps)
If you have better methods of completing this program, do share them here!!