str没有marketrans属性如何解决?
python 3.9.6VS Code
>>> str1 = "xiaoxie,DAXIE"
>>> print(str1.translate(str.marketrans('a','b')))
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
print(str1.translate(str.marketrans('a','b')))
AttributeError: type object 'str' has no attribute 'marketrans'
拼写错误
maketrans 尴尬{:5_107:}
页:
[1]