99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2021-03-26 閱讀量: 1437
python報(bào)錯(cuò) TypeError: '<'not supported between instances of 'str' and 'int'

問:

python報(bào)錯(cuò) TypeError: '<'not supported between instances of 'str' and 'int'

image.png


答:

這是因?yàn)樵趐ython中input()語句輸入的內(nèi)容默認(rèn)為字符串類型,而字符串類型的變量與整數(shù)型變量

之間不支持‘<’比較操作,因此會出現(xiàn)報(bào)錯(cuò)。解決方法是先將input()的內(nèi)容轉(zhuǎn)換為整數(shù)型,再進(jìn)行比較,如下:

image.png


99.9374
0
關(guān)注作者
收藏
評論(0)

發(fā)表評論

暫無數(shù)據(jù)
推薦帖子