python check if string in list and get index