-1
Have string
in Python stored in a variable and I want to check if it exists within a list.
I used the in
for that more even with the output equal to that in the list it does not return me correctly
What I tried to:
EAN = 7896000111371
quantidade = 1
quantidade = EAN,quantidade
print(quantidade)
if quantidade in lista :
print(f"quantidade confere: {quantidade}")
print("#------------------------------#")
else:
print(f"Quantidade INVALIDO: {quantidade}")
print("#------------------------------#")
Exit:
EAN encontrado: 7896000111371 ('7896000111371', '1') Quantidade INVALIDO: ('7896000111371', '1')
List:
[['7890000103404', '1'], ['7896000100634', '2'], ['7896000111371', '1'], ['7896000104335', '2'], ['7896000111364', '1'], ['7890000101059', '2'], ['7890000100724', '1'], ['7896000100870', '1'], ['7890000100472', '2'], ['7890000101943', '2'], ['7896000108869', '1'], ['7896000108852', '1'], ['7896000101679', '1'], ['7890000100816', '1'], ['7896000109040', '1'], ['7896000102324', '1'], ['7890000101219', '1'], ['7896000102768', '1'], ['7890000100687', '1'], ['7896000106322', '1']]
Good answer =)
– Jéf Bueno