We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0 parents commit 26be166Copy full SHA for 26be166
Anagram.py
@@ -0,0 +1,18 @@
1
+import random
2
+file_obj = open("words.txt")
3
+file_data = file_obj.read()
4
+lines = file_data.splitlines()
5
+test = True
6
+while test == True:
7
+ pick = lines[random.randrange(0, 976)]
8
+ letter = list(pick)
9
+ random.shuffle(letter)
10
+ print("".join(letter))
11
+ print("Enter endLoop to stop.")
12
+ userInp = input("Your guess: ")
13
+ if userInp == pick:
14
+ print("You got it right!")
15
+ elif userInp == "endLoop":
16
+ break
17
+ else:
18
+ print("You got it wrong! The correct answer was ", pick, ".")
0 commit comments