I am working on Windows 10 and Pycharm IDE.
Is there a reason that .isascii()
does not work on google colab? When I try the snippet of code on google colab I'm getting:
AttributeError: 'str' object has no attribute 'isascii'
If I try the same code on my IDE I'm getting True
.
thisstr = "Hoho"
k = thisstr.isascii()
print(k)
The python version in Google Colab is 3.6 while isascii
method is introduced in Python 3.7. Quoting from What's new in Python 3.7:
str
,bytes
, andbytearray
gained support for the new isascii() method, which can be used to test if a string or bytes contain only the ASCII characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With