n=int(input("enter max range")) num=1 while(num<=n): count=0 i=2 while(i<=num/2): if (num%i==0): count=count+1 break i=i+1 if(count==0&num!=1): print(num) num=num+1
Preview:
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