Skip to content

Instantly share code, notes, and snippets.

@Ge0
Created February 5, 2018 21:30
Show Gist options
  • Save Ge0/3d103315b54d47ff3c3737b31e1b4ed9 to your computer and use it in GitHub Desktop.
Save Ge0/3d103315b54d47ff3c3737b31e1b4ed9 to your computer and use it in GitHub Desktop.
Prime number next to X
x=input()+1
while 1:
if(all(x%j for j in range(2,int(x**.5)+1))):print([x,2][x==1]);break
x+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment