首页 > 解决方案 > TypeError:'int'和'dict'的实例之间不支持'<='

问题描述

我得到错误: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)

标签: pythonpython-3.x

解决方案


推荐阅读