Python Program Errors
I am a beginner Python Programmer, In my profile a game called Tic Tac Toe I made to test out my skill or lack of skill. I would ask for insight, tips and corrections to my code. Please copy and paste the code into your IDLE or compiler as the Solo Learn play ground does not handle inputs as well as I like. The code is also here... I also get a error when I press <enter> while in a input. Is there a way around this? Another error is in line 35, i try to reset the list to its base state of "board = ['1', '2', '3', '4', '5', '6', '7', '8', '9']" and it doesn't work. import random, re ''' Name: Elison Crum underscore before variable is a global variable ''' board = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] global _score global _npc_score _score = 0 _npc_score = 0 _name = "Elison" def checkLine(char, spot1, spot2, spot3): if board[spot1] == char and board[spot2] == char and board[spot3] == char: return True def checkAll(char): if checkLine(char, 0, 1, 2): return True if checkLine(char, 3, 4, 5): return True if checkLine(char, 6, 7, 8): return True if checkLine(char, 2, 5, 8): return True if checkLine(char, 1, 4, 7): return True if checkLine(char, 0, 3, 6): return True if checkLine(char, 0, 4, 8): return True if checkLine(char, 2, 4, 6): return True def reset(): board = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] board_render() def board_render(): print(_name + " : " + str(_score) + " NPC : " + str(_npc_score) + "\n") print(" "*5 + board[0] + " | " + board[1] + " | " + board[2]) print(" "*5 + "-"*9) print(" "*5 + board[3] + " | " + board[4] + " | " + board[5]) print(" "*5 + "-"*9) print(" "*5 + board[6] + " | " + board[7] + " | " + board[8] + "\n") def npc_turn(): global _npc_score while True: npc_spot = random.randint(0,8) if board[npc_spot] != 'x': board[npc_spot