我有的
import random
listofLetters =['k', 'i', 'n', 'g']
x = random.choice(listofLetters)
print x
listDash = []
print "Welcome to Gues the Letter Game!"
print " "
print "=" * 5 + "Start of Game" + "=" * 5
print ['_', '_', '_', '_', '_']
print " "
maxLife = 4
print "*" * 3 + "Life Line" + "*" * 3
print "-+" * maxLife
print "$|" * maxLife
print "-+" * maxLife
print " "
guess = raw_input("Enter your guess: ")
howmanyletter = len(guess)
if guess == x:
print "*" * 3 + "Life Line" + "*" * 3
print "-+" * maxLife
print "$|" * maxLife
print "-+" * maxLife
else:
print "Incorrect Guess []
我想[]
用猜测替换
例如[k]