python if x in list time complexity