Python學習中日常報錯總結

2021-10-09 23:05:48 字數 958 閱讀 8080

解答:字面意思,就是輸入了中文的東西,常見的有空格、引號等

age=18

print(message)

報錯:

原因:python中無法識別你使用的資訊。比如在這個示例中,python發現使用乙個int型的變數,但是它不知道該如何即使他。python知道,這個變數表示的可能是數值23,也可能是字元2和3。所以要改一下

調整後:

age=18

print(message)

name=input("name:")

age=input("age:")

job=input("job:")

info='''---------info of ---------

name:%s

age:%d

job:%s'''%(name,age,job)

print(info)

報錯:

修改:

name=input("name:")

age=int(input("age:")) #如果不用int()就會報錯(雖然輸入為數字,但是print(type(age))為str型),因為python如果不強制型別轉化,就會預設字元型

job=input("job:")

info='''---------info of ---------

name:%s

age:%d

job:%s'''%(name,age,job)

print(info)

Python 日常報錯總結

本章內容 執行 res requests.post api,mdata post data 報錯 sslerror eof occurred in violation of protocol ssl.c 600 命令測試 顯然ssl握手沒有成功,檢視openssl version 版本,不是最新的版...

Nginx日常報錯處理總結

在nginx錯誤日誌中,有大量的下列資訊 upstream timed out 110 connection timed out while reading response header from upstream root www vhosts tailf usr local nginx log...

日常學習總結

關於vb中的把字串 日期型 數值型 賦值給某個變數的寫法 eg dim m1,r 此處我並不清楚 m1 到底是什麼型別 所以vb會自動匹配其應該所屬的型別,這是vb的一點強大之處 m select fitemid from t item where fitemclassid 3 and fnumbe...