【发布时间】:2020-11-27 04:17:30
【问题描述】:
我正在使用 Windows 10 和 Pycharm IDE。
.isascii() 在 google colab 上不起作用是有原因的吗?当我在 google colab 上尝试代码的 sn-p 时,我得到:
AttributeError: 'str' object has no attribute 'isascii'
如果我在 IDE 上尝试相同的代码,我会收到 True。
thisstr = "Hoho"
k = thisstr.isascii()
print(k)
【问题讨论】:
-
我在我的机器上的 Python 控制台中运行了您的代码,结果为真,而 Google Colab 则抛出了一个错误。太奇怪了。
标签: python python-3.x google-colaboratory