File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ Instead, use a list comprehension:
352352 four_lists = [[] for __ in xrange (4 )]
353353
354354 Create a string from a list
355- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
356356
357357A common idiom for creating strings is to use :py:meth: `str.join ` on an empty
358358string.
@@ -366,7 +366,7 @@ This will set the value of the variable *word* to 'spam'. This idiom can be
366366applied to lists and tuples.
367367
368368Searching for an item in a collection
369- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370370
371371Sometimes we need to search through a collection of things. Let's look at two
372372options: lists and sets.
@@ -379,7 +379,7 @@ Take the following code for example:
379379 l = [' s' , ' p' , ' a' , ' m' ]
380380
381381 def lookup_set (s ):
382- return ' s' in d
382+ return ' s' in s
383383
384384 def lookup_list (l ):
385385 return ' s' in l
You can’t perform that action at this time.
0 commit comments