Skip to content

Commit 26be166

Browse files
Add files via upload
0 parents  commit 26be166

File tree

2 files changed

+993
-0
lines changed

2 files changed

+993
-0
lines changed

Anagram.py

+18
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)