diff --git a/advanced-iterators.html b/advanced-iterators.html
index 98eee7a..96f1314 100755
--- a/advanced-iterators.html
+++ b/advanced-iterators.html
@@ -51,7 +51,7 @@ import itertools
def solve(puzzle):
words = re.findall('[A-Z]+', puzzle.upper())
unique_characters = set(''.join(words))
- assert len(unique_characters) <= 10, 'Too many letters'
+ assert len(unique_characters) <= 10, 'Too many letters'
first_letters = {word[0] for word in words}
n = len(first_letters)
sorted_characters = ''.join(first_letters) + \
@@ -164,11 +164,11 @@ if __name__ == '__main__':
>>> assert 1 + 1 == 2 ①
>>> assert 1 + 1 == 3 ②
Traceback (most recent call last):
- File "<stdin>", line 1, in
assert statement is followed by any valid Python expression. In this case, the expression 1 + 1 == 2 evaluates to True, so the assert statement does nothing.
@@ -335,7 +335,7 @@ StopIteration
What does this have to do with the itertools module? I’m glad you asked.
-…continuing from the previous interactive shell… +…continuing from the previous interactive shell… >>> import itertools >>> groups = itertools.groupby(names, len) ① >>> groups @@ -582,8 +582,8 @@ NameError: name '__import__' is not defined >>> eval("__import__('subprocess').getoutput('rm -rf /')", ... {"__builtins__":None}, {}) ② Traceback (most recent call last): - File "
", line 1, in - File " ", line 1, in + File "<stdin>", line 1, in + File "<string>", line 1, in NameError: name '__import__' is not defined
"__builtins__" to None, the Python null value. Internally, the “built-in” functions are contained within a pseudo-module called "__builtins__". This pseudo-module (i.e. the set of built-in functions) is made available to evaluated expressions unless you explicitly override it.