File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Prerequisites
2
+ + Python 3.x
3
+ + Import of random module
4
+
5
+ ## Workings of Code
6
+ + Imports random module --> Selective import can be done of random.choice() only
7
+ +
8
+ + The code uses both for and while loops
9
+ +
10
+ + The while loop is infinite, and option to exit the program is given to user
11
+ +
12
+ + User enters question and answer which is accepted via an input()
13
+ +
14
+ + These input question-answers are stored in a dictionary as key-value pairs (key = question, value = answer)
15
+ +
16
+ + After input by the user, stored questions are randomly asked to user using random.choice() from random module
17
+ +
18
+ + Answers are verified by calling the question stored in the dictionary
19
+ +
20
+ + Code ends when user inputs "n" to indicate that they wish to exit, or when every question has been asked.
You can’t perform that action at this time.
0 commit comments