python check if element in list time complexity