-
-
Save stephengruppetta/1ee2bffaf2becbcf94e7d0cfe8fc1eeb to your computer and use it in GitHub Desktop.
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
class RandomWalk: | |
def __init__(self, iterable): | |
self.values = list(iterable) | |
def __iter__(self): | |
# We'll change this later | |
return self.values | |
captains = RandomWalk( | |
[ | |
"Pike", | |
"Kirk", | |
"Picard", | |
"Sisko", | |
"Janeway", | |
"Riker", | |
] | |
) | |
for captain in captains: | |
print(captain) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment