Hi, i'm a beginner in python and programmation, and i have a doubt about comparison in lists, I have this error
the error is in this line, according to pycharm.
Thanks
Error:TypeError: '>' not supported between instances of 'int' and 'list'
but i can try three times after this, so that means it goes into my IF block, right ? the error is in this line, according to pycharm.
if lista1[1] > maior: maior = lista[1]the code is written in Portuguese, i hope you can understand.
Thanks
lista = [] lista1 = [] cont = 's' maior = menor = pessoas = contador = 0 while cont in 'Ss': lista1.append(str(input(' NOME : '))) lista1.append(int(input(' PESO : '))) lista.append(lista1[:]) pessoas += 1 contador += 1 print(lista1[1]) # 38 88 11 if contador == 1: maior = lista1[1] menor = lista1[1] else: if lista1[1] > maior: maior = lista[1] if lista1[1] < menor: menor = lista1[1] lista1.clear() cont = str(input('Quer continuar ? [S/N]')) print(f'Foram cadastradas {pessoas} pessoas ') print(lista) print(f'o mais pesado pesa {maior} e o mais leve pesa {menor}')