Python教程

<' not supported between instances of 'str' and 'int' python报错问题解决

本文主要是介绍<' not supported between instances of 'str' and 'int' python报错问题解决,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

我的问题是在字典里放K,有些事Str有些int,所以报这个错,可以是str和int不能比较,所以获取的散列值有歧义,所以不允许。

 for i,item in enumerate(i):
                if i == 25:
                    temp[str(i)] = str(item)
                else:    
                    temp[str(i)] = item

解决办法,都写成一样的

这篇关于<' not supported between instances of 'str' and 'int' python报错问题解决的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!