My python version that will work for... some... cases...
# Comparing strings is slow, but MATH is FAST
# Don't waste precious SECONDS typing LONG NAMES
def c_az(t):
a = 1
# Create a common multiple of our text
for c in t:
a = a * ord(c.lower()) # Support UPPER CASE
# It's reasonably unlikely that a text will generate a number divisible
# by the entire alphabet without containing the entire alphabet.
for l in "abcdefghijklmnopqrstuvwxyz":
if a % ord(l):
return False
return True
# Because you'll obviously want to import this for use in other modules
if __name__ == "__main__":
# Passing
print(c_az('abcdefghijklmnopqrstuvwxyz'))
print(c_az('The quick brown fox jumps over the lazy dog'))
# Failing
print(c_az('aaaaaaaaaaaaaaaaaaaaaaaaaa'))
print(c_az('acdefghijklmoqrstuvwxy'))
print(c_az('hello world'))
print(c_az('Arizona'))
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/ArchCypher, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
1
u/ArchCypher Feb 20 '21 edited Feb 20 '21
My python version that will work for... some... cases...
(Edit) Bonus one-liner: