Skip to content

Commit 7978d6b

Browse files
committed
Hotfix
1 parent 22bfa58 commit 7978d6b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

exercises/ex41.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@
2525
def lingo(words):
2626
# Choose a word from the list randomly
2727
hidden = words[randrange(0, len(words))]
28-
29-
# map to build clue
28+
29+
# Map to build clue
3030
sym_map = {0: "%s", 1:"(%s)", 2: "[%s]"}
3131
def lingo_finder(guess):
3232
# 0: letter not present in the hidden word
3333
# 1: letter present but position is wrong
3434
# 2: correct letter and position
3535
cenc = [(int(guess[i] == hidden[i])) + int(guess[i] in hidden) for i in range(5)]
36-
# enclose the letter with appropriate symbols using sym_map
37-
print("".join([sym_map[cenc[i]]%guess[i] for i in range(5)]))
36+
# Enclose the letter with appropriate symbols using sym_map
37+
print "".join([sym_map[cenc[i]]%guess[i] for i in range(5)])
3838
return hidden != guess
39-
39+
print
40+
4041
if len(hidden) == 5:
4142
is_wrong=True
42-
# until guess is right
43+
# Until guess is right
4344
while is_wrong:
4445
# If user provides a word longer than 5 characters, we
4546
# truncate it
46-
guess = input()[:5]
47+
guess = raw_input()[:5]
4748
is_wrong = lingo_finder(guess.lower())
48-
print("You guessed it!")
49+
print "You guessed it!"
4950

5051

51-
#test
52+
# Test
5253
lingo(['alley', 'tally', 'valet', 'tiger', 'house', 'cigar', 'opera', 'modem', 'horse', 'plane', 'white', 'fiery'])
53-

0 commit comments

Comments
 (0)