-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex068.py
More file actions
24 lines (24 loc) · 704 Bytes
/
ex068.py
File metadata and controls
24 lines (24 loc) · 704 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
from random import randint
v = 0
while True:
jogador = int(input('Escolha um numero: '))
pc = randint(0, 11)
total = jogador + pc
tipo = ' '
while tipo not in 'PI':
tipo = str(input('Par ou Impar?[P/I]')).strip().upper()[0]
print(f'Jogador vc escolheu {jogador} e Computador jogou {pc} e o total foi {total}:')
if tipo == 'P':
if total % 2 == 0:
print('Vc ganhou!')
else:
print('Vc perdeu! ')
break
if tipo == 'I':
if total % 2 == 1:
print('Vc ganhou!')
else:
print('Vc perdeu!')
break
print('Vamos jogaro novamente? ')
print(f'Game Over. Vc ganhou {v}!')