Skip to content

Instantly share code, notes, and snippets.

@benevidesh
Created April 25, 2017 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benevidesh/7c750980fd1df3e08c02364994cb6078 to your computer and use it in GitHub Desktop.
Save benevidesh/7c750980fd1df3e08c02364994cb6078 to your computer and use it in GitHub Desktop.
numeroDoUsuario = int(input('Digite um número: '))
divisor = 2
Primo = True
while divisor < numeroDoUsuario and Primo:
if numeroDoUsuario % divisor == 0:
Primo = False
divisor += 1
if numeroDoUsuario == 1 or not Primo:
print('não primo')
else:
print('primo')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment