我有整数变量,但Python仍然说它是一个字符串

时间:2017-10-21 21:17:50

标签: python instances

我在Jupyter笔记本中用python3编程。 我想找到最温暖的温度。温度都是数字,在我的代码中我也将数字推到一个整数。 这是我的代码:

warm = -100

for i in range(4, len(climate)):
    temp = int(climate[i][3])
    if temp > warm:
        warm = climate[i][3]
print(warm)

我收到此错误消息

TypeError: '>' not supported between instances of 'int' and 'str'

有人看到问题所在吗?

0 个答案:

没有答案