0
People need to get out of a drama where I can’t finalize my logic without getting stuck in condition, the code is part of an old game that I’m perfecting, my condition in the code below says that the user input value has to be NUMERIC and if it is numeric it has to be <= 8, if it is not numeric it enters the loop for the user to type again.
a = input('Jogador "X", onde pretende fazer a jogada? ')
q = 1
while q == 1:
if a.isnumeric() and int(a) <= 8:
a = int(a)
break
else:
a = input('Jogador "X", digite um número de 0 a 8: ')
if int(a) == int(b) or j[a] == 'X' or j[a] == 'O':
while int(a) == int(b) or j[a] == 'X' or j[a] == 'O': #essa linha é responsável pelo erro
a = input('Jogador "X" por favor, escolha outro campo: ')
if a.isnumeric() and int(a) <= 8:
a = int(a)
else:
a = input('Jogador "X", digite um número de 0 a 8: ')
j[a] = 'X'insira o código aqui
where variable B comes from and which error you are facing exactly?
– FBidu
then the full game is here https://repl.it/JxEi/4 type in the sequence of entries 1, 1, 1, ', ' ....... i want the filter not to pass if the user wants to type a quote or something other than numeric
– Leandro de Oliveira