-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestionRun.py
More file actions
47 lines (29 loc) · 869 Bytes
/
QuestionRun.py
File metadata and controls
47 lines (29 loc) · 869 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
print('''
Multiple choic quize using python
Usint classes, if statements and loops
''')
from question import question
question_promts=[
"what colors are Apples?\n (a)Red/Green \n (b) Purple \n (c) Orange \n\n ",
"what colors are Bannas?\n (a)Teal \n (b) Magenta \n (c) Yellow\n\n ",
"what colors are strawberries?\n (a)Yellow \n (b) Red \n (c) Blue\n\n ",
]
questions =[
question(question_promts[0], "a"),
question(question_promts[1], "c"),
question(question_promts[2], "b")
]
def run_test(questions):
score=0
for question in questions:
answer = input(question.promt)
if answer == question.answer:
score+=1
print(" You got " + str(score) + " / out of " + str(len(questions)) + " correct")
run_test(questions)
print('''
''')
print('''
''')
print('''
''')