python check if item in list and get index