Created
March 15, 2018 21:53
-
-
Save turing4ever/5c3b3dc3701f985665df6e63eb713742 to your computer and use it in GitHub Desktop.
check if a string contains only ascii
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_ascii(s): | |
return all(ord(c) < 128 for c in s) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment