summaryrefslogtreecommitdiff
path: root/past-papers/mj-2024/Question1_J24.py
diff options
context:
space:
mode:
Diffstat (limited to 'past-papers/mj-2024/Question1_J24.py')
-rw-r--r--past-papers/mj-2024/Question1_J24.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/past-papers/mj-2024/Question1_J24.py b/past-papers/mj-2024/Question1_J24.py
new file mode 100644
index 0000000..c1b1629
--- /dev/null
+++ b/past-papers/mj-2024/Question1_J24.py
@@ -0,0 +1,20 @@
+global WordArray
+global NumberWords
+WordArray = []
+NumberWords = 0
+def ReadWords(filename: str):
+ with open(filename, 'r') as file:
+ WordArray = [line.strip('\n') for line in file.readlines()]
+ NumberWords = len(WordArray) - 1
+
+choice = input("Difficulty: easy; medium; hard? : ")
+if choice == "easy":
+ ReadWords("Easy.txt")
+elif choice == "medium":
+ ReadWords("Medium.txt")
+elif choice == "hard":
+ ReadWords("Hard.txt")
+
+def Play():
+ print(f"{WordArray[0]}; number of answers: {NumberWords}")
+ while \ No newline at end of file