diff --git a/advanced-iterators.html b/advanced-iterators.html index bdad90d..c6f9aad 100755 --- a/advanced-iterators.html +++ b/advanced-iterators.html @@ -205,7 +205,7 @@ AssertionError: Only for very large values of 2 >>> tuple(ord(c) for c in unique_characters) ④ (69, 68, 77, 79, 78, 83, 82, 89)
next(gen) returns the next value from the iterator.
tuple(), list(), or set(). In these cases, you don’t need an extra set of parentheses — just pass the “bare” expression ord(c) for c in unique_characters to the tuple() function, and Python figures out that it’s a generator expression.
@@ -408,7 +408,7 @@ Wesley
'N': '5', 'S': '1', 'R': '6', 'Y': '7'}
zip function will create a pairing of letters and digits, in order.
-dict() function to create a dictionary that uses letters as keys and their associated digits as values. (This isn’t the only way to do it, of course. You could use a dictionary comprehension to create the dictionary directly.) Although the printed representation of the dictionary lists the pairs in a different order (dictionaries have no “order” per se), you can see that each letter is associated with the digit, based on the ordering of the original characters and guess sequences.
+dict() function to create a dictionary that uses letters as keys and their associated digits as values. (This isn’t the only way to do it, of course. You could use a dictionary comprehension to create the dictionary directly.) Although the printed representation of the dictionary lists the pairs in a different order (dictionaries have no “order” per se), you can see that each letter is associated with the digit, based on the ordering of the original characters and guess sequences.
The alphametics solver uses this technique to create a dictionary that maps letters in the puzzle to digits in the solution, for each possible solution. @@ -610,7 +610,7 @@ NameError: name '__import__' is not defined
re.findall() function
-set() function
assert statement
itertools.permutations() function
diff --git a/strings.html b/strings.html
index 6d0fca9..98c02d1 100755
--- a/strings.html
+++ b/strings.html
@@ -264,7 +264,7 @@ experience of years.
split() string method takes one argument, a delimiter, and split a string into a list of strings based on the delimiter. Here, the delimiter is an ampersand character, but it could be anything.
-'key=value=foo'.split('='), we would end up with a three-item list ['key', 'value', 'foo'].)
+'key=value=foo'.split('='), we would end up with a three-item list ['key', 'value', 'foo'].)
dict() function.