Skip to content

Instantly share code, notes, and snippets.

@jordan-medium
Created March 7, 2021 02:05
def infinite_seq():
count = 1
while True:
yield count ** 2
count = count + 1
infinite_stream = infinite_seq()
print( next(infinite_stream) )
print( next(infinite_stream) )
print( next(infinite_stream) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment