Uncategorized

regex – != operator not working after indexing python list



mmo='108.00 Mfd MS Box 2/T 440v Agri Gold'
try:
   if str(re.findall("[Aa][Gg][rR][iI] [Gg][oO][lL][dD]",mmo)[0]).upper()!="AGRI GOLD":
   print("no agrigold")
except:
    print("none")

when i use equal to operator it is working and when i use not equal to operator it is not working.please help me out



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *