Infinite Sequences in Python - Fibonacci Like You Have Never Seen
·1071 words·6 mins
Did you know you can create an infinite sequence without running into memory problems and still consume that sequence however you like? Today we will look at a specific function from the itertools module, islice, which is excellent for our purpose. We will learn to use it with the example of the Fibonacci sequence.