Skip to content

Commit 680c4b7

Browse files
authored
Create LETTER GUESSER
1 parent 2e744fd commit 680c4b7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

LETTER GUESSER

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import random
2+
import string
3+
4+
ABCS = string.ascii_lowercase
5+
ABCS = list(ABCS)
6+
7+
play = True
8+
9+
compChosse = random.choice(ABCS)
10+
11+
print(":guess the letter (only 10 guesses):")
12+
userInput = input("guess:")
13+
14+
failed = 10
15+
16+
while failed > 0:
17+
if userInput == compChosse:
18+
print("---------->")
19+
print("You are correct!")
20+
print("---------->")
21+
print("Your guesses: " + str(10 - failed))
22+
break
23+
24+
elif userInput != compChosse:
25+
failed = failed - 1
26+
27+
print(":no your wrong: " + "left: " + str(failed))
28+
29+
userInput = input("guess:")
30+
31+
if failed == 0:
32+
print("out of guesses")

0 commit comments

Comments
 (0)