Prime Number on Python

We’ve done it using Delphi, how about Python? Easy, 🙂


for i in range (2,200):
    prime = True
    for j in range (2,i):
        if i%j==0: 
            prime=False
    if prime==True:
        print i


.

via Blogger http://ift.tt/2nKAHSs

Advertisements