-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpanishQuiz.py
53 lines (43 loc) · 2.22 KB
/
SpanishQuiz.py
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
## Spanish Verb Quiz
class Quiz:
def __init__(self, prompt, answer):
self.prompt = prompt
self.answer = answer
spanishQuestions = [
"What's the future tense of the verb hacer in the 2nd person singular?\n(a)harás\n(b)hará\n(c)haremos\n(d)haré\n",
"What's the imperfect tense of the verb hablar in the 3rd person plural?\n(a)hablaste\n(b)hablé\n(c)hablaban\n(d)hablaron\n",
"What's the present subjunctive verb decir in the 1st person plural?\n(a)dijéramos\n(b)digo\n(c)digamos\n(d)dijiste\n",
"What's the present indicative of the verb ser in the 3nd person singular?\n(a)sea\n(b)es\n(c)seas\n(d)eres\n",
"What's the present subjunctive verb querer in the 1st person plural?\n(a)queramos\n(b)quieren\n(c)queremos\n(d)querremos\n",
"What's the future tense of the verb ver in the 1st person plural?\n(a)veremos\n(b)vemos\n(c)verán\n(d)vean\n",
"What's the imperfect tense of the verb estudiar in the 3rd person plural?\n(a)estudiaré\n(b)estudiaste\n(c)estudiaban\n(d)estudiaremos\n",
"What's the present subjunctive of the verb amar in the 1st person plural?\n(a)amamos\n(b)amemos\n(c)amáramos\n(d)amarán\n",
"What's the present indicative of the verb estar in the 3nd person plural?\n(a)estaban\n(b)estarán\n(c)están\n(d)son\n",
"What's the future tense of the verb sonreír in the 1st person singular?\n(a)sonrien\n(b)sonries\n(c)sonreía\n(d)sonreiré\n",
"What's the present tense of the verb resolver in the 1st person plural?\n(a)resolvemos\n(b)resolvimos\n(c)resolveremos\n(d)resuelve\n",
]
questionsList = [
Quiz(spanishQuestions[0], "a"),
Quiz(spanishQuestions[1], "c"),
Quiz(spanishQuestions[2], "c"),
Quiz(spanishQuestions[3], "a"),
Quiz(spanishQuestions[4], "a"),
Quiz(spanishQuestions[5], "a"),
Quiz(spanishQuestions[6], "c"),
Quiz(spanishQuestions[7], "b"),
Quiz(spanishQuestions[8], "c"),
Quiz(spanishQuestions[9], "d"),
Quiz(spanishQuestions[10], "a"),
]
def main(spanishQuestions):
score = 0
counter = 1
total = int(len(questionsList))
for question in questionsList:
print(f"Question #{counter}:")
counter += 1
answer = input(question.prompt + "\n>>> ")
if answer == question.answer:
score += 1
print("Congrats! You guessed {:.0%} percent correctly.".format(score/total))
main(questionsList)