low=int(input('enter lower range:'))
high=int(input('enter heigher range:'))
for i in range(low,high+1):
for j in range(2,i//+1):
if i%j==0:
break
else:
print(i,end=' ')
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