-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1teste.py
More file actions
51 lines (42 loc) · 964 Bytes
/
Copy path1teste.py
File metadata and controls
51 lines (42 loc) · 964 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
42
43
44
45
46
47
48
49
50
def baralho(naipe):
for i in range(13):
naipe.append(0)
def contagem_baralho(naipe):
cont = 13
for i in range(len(naipe)):
if naipe[i] == 1:
cont -= 1
if naipe[i] >= 2:
print("erro")
return()
print(cont)
cartas = input()
numeros = []
naipes = []
for i in range(0, len(cartas), 3):
cart = cartas[i:i+2]
numeros.append(int(cart))
for i in range(2, len(cartas), 3):
nai = cartas[i]
naipes.append(nai)
paus = []
baralho(paus)
copas = []
baralho(copas)
espadas = []
baralho(espadas)
ouros = []
baralho(ouros)
for i in range(len(naipes)):
if naipes[i] == "P":
paus[numeros[i]-1] += 1
if naipes[i] == "C":
copas[numeros[i]-1] += 1
if naipes[i] == "E":
espadas[numeros[i]-1] += 1
if naipes[i] == "U":
ouros[numeros[i]-1] += 1
contagem_baralho(copas)
contagem_baralho(espadas)
contagem_baralho(ouros)
contagem_baralho(paus)