Python Forum
Tic Tac Toe except Valueerror help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tic Tac Toe except Valueerror help
#8
(Jul-11-2018, 01:59 AM)Minindis02 Wrote:
(Jul-11-2018, 12:41 AM)Minindis02 Wrote:
(Jul-10-2018, 01:24 PM)volcano63 Wrote: Python does not like mixture of tabs and spaces. I recommend to check you code for tabs - and replace them with 4 spaces. Adjust your editor to insert 4 spaces when you press tab
Hi, The thing is it is set to 4 spaces and ive checked that theres no more than 4 spaces for the lines however it still says that it is inconsistent. Does anyone know why this could be... thanks.
Oh ok thanks that part is working now, do you or anyone know how to get the "in range0-9" part working? because i dont really know how to make it so that if someone inputs "20" or something it says "Please enter a valid number" or something. THanks.
says "Traceback (most recent call last):
File "C:\Users\Tissa\Desktop\TTTProgram.py", line 96, in <module>
won = chooseMove(boardList)
File "C:\Users\Tissa\Desktop\TTTProgram.py", line 21, in chooseMove
if boardValues[squareChoice] != "X" and boardValues[squareChoice] != "O": ## checks to see that the chosen square is not already occupied.
IndexError: list index out of range"
Reply


Messages In This Thread
Tic Tac Toe except Valueerror help - by Minindis02 - Jul-10-2018, 06:39 AM
RE: Tic Tac Toe except Valueerror help - by Minindis02 - Jul-11-2018, 03:06 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020