I'm making easy Tic Tac Toe game (not as easy as I thought it would be). I want to create a function that asks player which sign would like to play (x or o). I have a problem with returning values. It just won't return anything... like nothing has changed.
player_choice = ''
computer_choice = ''
def player_sign(player, computer):
choice = raw_input("Do you want to be X or O?: ").lower()
while choice != 'x' and choice != 'o':
print "Error!\n Wrong input!"
choice = raw_input("Do you want to be X or Y?: ").lower()
if choice == 'x':
print "X is yours!"
player = 'X'
computer = 'O'
return player, computer
elif choice == 'o':
print "You've chosen O!"
player = 'O'
computer = 'X'
return player, computer
else:
print "Error!\n Wrong input!"
return 0
player_sign(player_choice, computer_choice)
Tried with samples like assigning values to player_choice and computer_choice and it prints the initial string. What am I doing wrong?