-1
I’m looking to identify if in my input there are any words that are on a list of words that I created. The code runs normal without presenting any error, however, is missing the result always.
Code:
x = input('Insira aqui o email:\n')
x = re.sub('-'," ", x)
x = str(x)
x=x.lower()
x=x.translate(punc_table)
import csv
with open("fornecedores.csv") as f_obj:
reader = csv.reader(f_obj)
providerlist = list(reader)
providerlist = [[k.lower()] for l in providerlist for k in l]
x = x.split()
res = [ele for ele in x if(ele in providerlist)]
print("Does string contain any list element : " + str(bool(res)))
What is the result that is coming out?
– Boneco Sinforoso
Always returns False. Even though my input has a single word that is present in.csv vendors
– Mauricio Carneiro Goulart