tuples - call back in python Tic Tac Toe code -


so have code right here tic tac toe program

def playerid():     # asks player if want x or y     letter = ''     while not (letter == 'x' or letter == 'o'):         letter = input('do want x or o?').upper()      # first tuple player, second computer     if letter == 'x':         return ['x', 'o']     else:         return ['o', 'x'] 

and second half of code is

while true:     # resets board     theboard = [' '] * 10     playerletter, computerletter = playerid()     turn = playfirst()     print('the ' + turn + ' go first.') 

it continues on after it's giving me 2 error's. don't think it's case sensitive. i'm not strings or arrays, point i'm doing wrong here?

i think problem call back, of course talking out of butt.

you should use raw_input instead of input string values in python 2.x


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -