鍍金池/ 問(wèn)答/Python/ python 中的報(bào)錯(cuò)

python 中的報(bào)錯(cuò)

pwd="sw892130"
h1=hashlib.md5()
h1.update(str.encode(encode='utf-8'))

clipboard.png

回答
編輯回答
離人歸

你定義了變量pwd卻沒(méi)用?筆誤吧

2017年4月23日 14:19
編輯回答
老梗
pwd="sw892130"
h1=hashlib.md5()
h1.update(bytes(pwd, encoding='utf-8'))
print(h1.hexdigest())

你可以看看這篇文章——https://www.cnblogs.com/xiaob...

2018年9月1日 08:20
編輯回答
玄鳥
import hashlib
pwd="sw892130"
h1=hashlib.md5()
h1.update(pwd.encode('utf-8'))
print(h1.hexdigest())

不知道你從哪來(lái)的奇怪的語(yǔ)法,這里使用的是Python3

2018年1月21日 17:33