[training] Python – prime number

num = int(input("Please input a number: "))

for i in range(2, num):
    for j in range(2, i):
        if (i % j == 0):
            break
        
        if (i == j + 1):
            print(i)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.