Ask coding questions

← Back to all posts
I don't get it.
AmazingCoderE (0)

My code seems to just break at the first "continue" and does not do the rest of the code. Does anybody know why? Here is the segment where my code breaks:

while True:
print_board (board)
user_input = input("Please enter a position 1 through 9 or enter \"q\" to quit:")
if quit(user_input):break
if not check_input(user_input):
print("Please try again.")
continue <------- Code brakes here.
user_input = int(user_input) - 1
board[0] = "x"
coords = coordinates(user_input)
if istaken(coords, board):
print("Please try again.")
add_to_board(coords, board)

Saml2020 (66)

First, try and format code this way

#Code goes here
print("Hello World")

continue will skip the rest of the code in the loop and go to the next iteration. Which in your case, goes to the start of the while loop (Line 64).