TypeError:“ int”和“ dict”的实例之间不支持“ <=”

时间:2019-05-22 20:34:41

标签: python python-3.x

我收到错误消息:while (low <= high) and list[low] <= x <= list[high]: TypeError: '<=' not supported between instances of 'int' and 'dict'

while low <= high and list[low] <= x <= list[high]:
    critical_op += 1
    if low == high:
        if list[low] == x:
            return low
        return -1

低= 0 高=(项目-1)

0 个答案:

没有答案