forked from fkenjikamei/python-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaula13-8.py
More file actions
41 lines (32 loc) · 636 Bytes
/
aula13-8.py
File metadata and controls
41 lines (32 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Um numero é primo se ele só possuir no máximo dois divisores
#O que é um divisor?
#R: quando dividimos um número por este, e o resto é ZERO
'''
4/4 = resto 0
4/3 = resto 1
4/2 = resto 0
4/1 = resto 0
12/12 = resto 0
12/11 = resto 1
12/10 = resto 2
12/9 = resto 3
12/8 = resto 4
12/7 = resto 5
12/6 = resto 0
12/5 = resto 7
12/4 = resto 0
12/3 = resto 0
12/2 = resto 0
12/1 = resto 0 *
'''
print("** Numero Primo **")
numero = int(input("Digite um numero: "))
cont = 0
for i in range(1, numero+1):
if numero%i==0:
cont = cont+1
print("Quantidade divisores: ",cont)
if cont<=2:
print("Primo")
else:
print("Nao primo")