Problem with python tray writing: 'TypeError: not all arguments converted during string formatting'

0

How can I resolve this? There's the code. '' looks like this:

[(((2,), (3,), (2,), (2, 2), (2,)), ((2,), (1, 2), (2,), (3,), (3,))), [['?', '?', '?', '?', '?'], ['?', '?', '?', '?', '?'], ['?', '?', '?', '?', '?'], ['?', '?', '?', '?', '?'], ['?', '?', '?', '?', '?']]]

The error is here: print ("[% s]"% t [i] [c], sep="\ n", end="")

Method:

def escreve_tabuleiro(t):

    n_linhas=len(tabuleiro_especificacoes(t)[0])
    lista_especificacoes=list(tabuleiro_especificacoes(t))

    maximo=max(map(len, lista_especificacoes[1]))
    minimo=[0]*(len(lista_especificacoes[1]))

    for h in range(maximo):
        for i in range(len(lista_especificacoes[1])):
            if maximo <= len(lista_especificacoes[1][i]):
                lista=list(lista_especificacoes[1][i])
                print("  %s  " % lista[minimo[i]],sep="",end="")
                minimo[i] +=1
            else:
                print("  %s  " % " ",sep="  ",end="")
        maximo=maximo-1
        print("  ")

    maximo=max(map(len,lista_especificacoes[0]))
    minimo=[0]*(len(lista_especificacoes[0]))

    for i in range(len(t)-1):
        for c in range(n_linhas+maximo):
            if c < n_linhas:
                print ("[ %s ]" % t[i][c],sep="\n",end="")
            else:
                if minimo[i] < len(lista_especificacoes[0][i]):
                    lista=list(lista_especificacoes[0][i])
                    print(' %s' % lista[minimo[i]],sep='',end='')
                    minimo[i] +=1
                else:
                    print(" %s" % " ", sep="",end="")
        print('|')

    print()

    
asked by anonymous 08.12.2015 / 13:05

0 answers