From 7a9cacda6d3dfd11d2fbc221b2527b1bc6ca80d5 Mon Sep 17 00:00:00 2001 From: matheusfvesco <114014793+matheusfvesco@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:44:42 -0300 Subject: [PATCH] Fixed code typo --- data_structures/arrays/pairwise_iteration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data_structures/arrays/pairwise_iteration.py b/data_structures/arrays/pairwise_iteration.py index db4ea3a62..2efada5c1 100644 --- a/data_structures/arrays/pairwise_iteration.py +++ b/data_structures/arrays/pairwise_iteration.py @@ -69,7 +69,7 @@ def pairwise_iteration_comprehension( """ Generate pairs of elements from an iterable with a given step size. - This function uses list comprehensions to get the itens that are step + This function uses list comprehensions to get the items that are step distance from each other and later the `iter()` conversion to create two independent list iterators (`a` and `b`) from the input iterable. The `next` function is used to offset the `b` iterator by one index, @@ -113,15 +113,15 @@ def pairwise_iteration_comprehension( >>> list(pairwise_iteration_comprehension(['a'], step=1)) [] """ - # creates a list, using list comprehensions, that only stores itens + # creates a list, using list comprehensions, that only stores items # that are n steps apart from each other. - itens = [item for i, item in enumerate(iterable) if i % step == 0] + items = [item for i, item in enumerate(iterable) if i % step == 0] # creates two independent list iterators (a and b) from the list # we created earlier, using the iter() function. This means we can # use next() on each one without affecting the other, no matter the # iterable type - a, b = (iter(itens), iter(itens)) + a, b = (iter(items), iter(items)) # Offsets the second iterator (b) by one step to create a staggered # alignment.