Skip to content

@ananthmv /gist:285690 forked from srid/gist:185695
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
def original():
for i in range(10):
for j in range(10):
for k in range(10):
if i == j and j == k:
yield "All equal"
elif (i == j and j != k) or (i == k and j != k):
yield "2 equal"
else:
yield "None equal"
def original2():
return ["All equal" if i==j and j==k else (
"2 equal" if (i==j and j!=k) or (i==k and j!=k) \
else "None equal")
for i in range(10)
for j in range(10)
for k in range(10)]
assert tuple(original()) == tuple(original2())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.