The text does a good job of explaining which route to take when
concatenating strings, but the mention of "join" might mean nothing to
beginners without a concrete example.
which is mutable, and then glue ('join') the parts together when the
full string is needed.
which is mutable, and then glue ('join') the parts together when the
full string is needed.
+**Bad**
+
+.. code-block:: python
+
+ # create a concatenated string from 0 to 19 (e.g. "012..1819")
+ nums = ""
+ for n in range(20):
+ nums += str(n) # slow and inefficient
+ print nums
+
+**Good**
+
+.. code-block:: python
+
+ # create a concatenated string from 0 to 19 (e.g. "012..1819")
+ nums = []
+ for n in range(20):
+ nums.append(str(n))
+ print "".join(nums) # much more efficient
+
Vendorizing Dependencies
------------------------
Vendorizing Dependencies
------------------------