想在游戏中加入判断,判断输入是否在元组范围内
from random import choice
print 'left or center or right'
a = raw_input('请输入方向:')
if a != ['left','center','right']:
print 'Yor are choose woring'
else:
print 'you shoot:' + a
direction = ['left','center','right']
com = choice(direction)
print 'Computer choose: '+com
if a != com:
print 'Goal!!!!!'
else:
print 'OH no!'