我正在使用 Windows 10 和 Pycharm IDE。有.isascii()没有在 google colab 上不起作用的原因?当我在 google colab 上尝试代码片段时,我得到:
AttributeError: 'str' object has no attribute 'isascii'
Run Code Online (Sandbox Code Playgroud)
如果我在我的 IDE 上尝试相同的代码,我会得到True.
thisstr = "Hoho"
k = thisstr.isascii()
print(k)
Run Code Online (Sandbox Code Playgroud)