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 pythagorean_triples(filter): | |
current = np.array([[3, 4, 5]]) # Initial seed | |
yield from current # Yield first triple | |
while current.shape[0]: # While work to do | |
current = next_pythagorean_triples(current) # Next iteration | |
current = filter(current) # Filter desired triples | |
yield from current # Yield each triple |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment