-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpratica72.py
More file actions
86 lines (67 loc) · 2.63 KB
/
pratica72.py
File metadata and controls
86 lines (67 loc) · 2.63 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Exercício - Sistema de Perguntas e Respostas
import os
import emoji
while True:
os.system('cls')
print('--' * 16)
print('🤘 QUIZ - ROCK N ROLL! ')
print('--' * 16)
perguntas = [
{
'Pergunta': 'Quem é o vocalista da banda Metallica?',
'Opções': ['Brian May', 'Freddie Mercury', 'James Hetfield', 'Bruce Dickinson'],
'Resposta': 'James Hetfield',
},
{
'Pergunta': 'Em que ano baixista do Metallica Cliff Burton morreu?',
'Opções': ['1962', '1989', '1986', '1989'],
'Resposta': '1986',
},
{
'Pergunta': 'Qual é o nome do pai de Freddie Mercury?',
'Opções': ['Kash Bulsara', 'Fredderic Bulsara', 'Jer Mercury', 'Bomi Bulsara'],
'Resposta':'Bomi Bulsara',
},
{
'Pergunta': 'Em que ano o disco do Queen A Night at the Opera foi lançado? ',
'Opções':['1986', '1985', '1975', '1995'],
'Resposta':'1975',
},
]
quantidade_acertos = 0
for pergunta in perguntas:
print('Pergunta:', pergunta['Pergunta'])
print()
opcoes = pergunta['Opções']
for i, opcao in enumerate(opcoes):
print(f'{i}) - {opcao}')
print()
escolha = input('Escolha uma opção: ')
acertou = False
escolha_int = None
quantidade_opcoes = len(opcoes)
if escolha.isdigit():
escolha_int = int(escolha)
if escolha_int is not None:
if escolha_int >= 0 and escolha_int < quantidade_opcoes:
if opcoes[escolha_int] == pergunta['Resposta']:
acertou = True
print()
if acertou:
quantidade_acertos += 1
print('👍 Acertou!')
else:
print('❌ Errou!')
print()
os.system('cls')
print(f'Você acertou {quantidade_acertos} perguntas de {len(perguntas)}')
if quantidade_acertos < 2:
print('Seu conhecimento em Rock n Roll não esta bom, pesquise mais. 💻')
else:
print('Parabéns! Você é Roqueiro...🎸 ')
jogar = input('Você deseja jogar Novamente? [Sim] / [Nao]: ').lower()
if jogar != 'sim' and jogar != 's':
os.system('cls')
print('Volte Sempre!')
print('Long Live Rock n Roll...\n')
break