Preview:
n=int(input('enter number:'))
for i in range(2,n+1):
    for j in range(2,i//+1):
        if i%j==0:
            break
    else:
        print(i,end=' ')
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter