Skip to content

Commit 7bdd613

Browse files
authored
Create README.md
Explanation of workings/ logic of flashcard.py
1 parent 6f813e6 commit 7bdd613

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Flash Card /README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.

0 commit comments

Comments
 (0)